This type defines the PlatformRequester.
More...
|
| PlatformRequester (string host, AccessTokenStorage accessTokenStorage, IConnectivityService connectivityService) |
|
IBeamableRequester | WithAccessToken (TokenResponse token) |
| Create a new IBeamableRequester that will authenticate all requests using the given TokenResponse argument. WARNING, this method is not supported inside Microservices. More...
|
|
Promise< T > | ManualRequest< T > (Method method, string url, object body=null, Dictionary< string, string > headers=null, string contentType="application/json", Func< string, T > parser=null) |
| Make an HTTP request to any address with no preconfigured authorization More...
|
|
string | EscapeURL (string url) |
| A utility method that will url escape a string. More...
|
|
void | DeleteToken () |
|
void | Dispose () |
|
UnityWebRequest | BuildWebRequest (Method method, string uri, string contentType, byte[] body) |
|
Promise< T > | RequestForm< T > (string uri, WWWForm form, bool includeAuthHeader=true) |
|
Promise< T > | RequestForm< T > (string uri, WWWForm form, Method method, bool includeAuthHeader=true) |
|
Promise< T > | Request< T > (Method method, string uri, object body=null, bool includeAuthHeader=true, Func< string, T > parser=null, bool useCache=false) |
| Make an authorized request to the Beamable API. More...
|
|
Promise< T > | RequestJson< T > (Method method, string uri, JsonSerializable.ISerializable body, bool includeAuthHeader=true) |
|
|
string | Host [getset] |
|
string | Cid [getset] |
|
string | Pid [getset] |
|
IAccessToken | AccessToken [get] |
|
AccessToken | Token [getset] |
|
string | Shard [getset] |
|
string | Language [getset] |
|
string | TimeOverride [getset] |
|
IAuthApi | AuthService [set] |
|
string | RequestTimeoutMs [getset] |
|
AccessToken | Token [getset] |
|
string | TimeOverride [getset] |
|
string | Cid [getset] |
|
string | Pid [getset] |
|
string | Language [getset] |
|
IAuthApi | AuthService [set] |
|
IAccessToken | AccessToken [get] |
| The IAccessToken the IBeamableRequester will use when making network calls with the Request<T> method.
|
|
This type defines the PlatformRequester.
Related Links
◆ DeleteToken()
void Beamable.Api.PlatformRequester.DeleteToken |
( |
| ) |
|
|
inline |
◆ EscapeURL()
string Beamable.Api.PlatformRequester.EscapeURL |
( |
string |
url | ) |
|
|
inline |
◆ ManualRequest< T >()
Promise< T > Beamable.Api.PlatformRequester.ManualRequest< T > |
( |
Method |
method, |
|
|
string |
url, |
|
|
object |
body = null , |
|
|
Dictionary< string, string > |
headers = null , |
|
|
string |
contentType = "application/json" , |
|
|
Func< string, T > |
parser = null |
|
) |
| |
|
inline |
Make an HTTP request to any address with no preconfigured authorization
- Parameters
-
method | One of the common HTTP methods represented through the Method enum |
url | |
body | The body of the network request. If the type of the body is an object, it will be serialized to JSON. If the type of the body is a string, no serialization will occur. |
headers | A dictionary where the keys are header names, and the values are the header values. |
contentType | A MIME type for the request. For example, "application/json". If the body is serialized to JSON, the contentType will become "application/json" by default. |
parser | By default, the network response will be assumed JSON and deserialized as such. However, if a parser is provided, the network response will be given the parser as a string. The parser can convert the string into the expected result type, T |
- Template Parameters
-
T | The type of the network response. The network response will be deserialized into an instance of T. You can override the parsing by passing a custom parser |
- Returns
- A Promise<T> of type T when the network request completes.
Implements Beamable.Common.Api.IHttpRequester.
◆ Request< T >()
Promise< T > Beamable.Api.PlatformRequester.Request< T > |
( |
Method |
method, |
|
|
string |
uri, |
|
|
object |
body = null , |
|
|
bool |
includeAuthHeader = true , |
|
|
Func< string, T > |
parser = null , |
|
|
bool |
useCache = false |
|
) |
| |
|
inline |
Make an authorized request to the Beamable API.
- Parameters
-
method | One of the common HTTP methods represented through the Method enum |
uri | A Beamable API relative uri. The uri may contain URL parameters. |
body | The body of the network request. If the type of the body is an object, it will be serialized to JSON. If the type of the body is a string, no serialization will occur. |
includeAuthHeader | When includeAuthHeader is true, the IAccessToken.Token value will be automatically passed in as the Authorization Header for the request. When the includeAuthHeader is false, no Authorization Header will be sent with the network request. |
parser | By default, the network response will be assumed JSON and deserialized as such. However, if a parser is provided, the network response will be given the parser as a string. The parser can convert the string into the expected result type, T |
useCache | When useCache is enabled, the network response will be written to disk and indexed by the uri, method, and includeAuthHeader. If the same request is sent later when the player is offline, the disk value will be read and given as a valid response. |
- Template Parameters
-
T | The type of the network response. The network response will be deserialized into an instance of T. You can override the parsing by passing a custom parser |
- Returns
- A Promise<T> of type T when the network request completes.
Implements Beamable.Common.Api.IBeamableRequester.
◆ WithAccessToken()
Create a new IBeamableRequester that will authenticate all requests using the given TokenResponse argument. WARNING, this method is not supported inside Microservices.
- Parameters
-
tokenResponse | A TokenResponse that will be used to create the AccessToken for the resulting requester. |
- Returns
- A new IBeamableRequester
Implements Beamable.Common.Api.IBeamableRequester.
The documentation for this class was generated from the following file:
- com.beamable/Runtime/Core/Platform/SDK/PlatformRequester.cs