This type defines the IBeamableRequester.
More...
This type defines the IBeamableRequester.
Related Links
◆ EscapeURL()
string Beamable.Common.Api.IBeamableRequester.EscapeURL |
( |
string |
url | ) |
|
◆ Request< T >()
Promise< T > Beamable.Common.Api.IBeamableRequester.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.
- 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.
Implemented in Core.Platform.SDK.BeamableApiRequester, and Beamable.Api.PlatformRequester.
◆ WithAccessToken()
The documentation for this interface was generated from the following file:
- com.beamable/Common/Runtime/Api/IBeamableRequester.cs