Nakama .NET Client SDK 3.8.0
Nakama .NET Client SDK
Loading...
Searching...
No Matches
Satori.HttpRequestAdapter Class Reference

HTTP Request adapter which uses the .NET HttpClient to send requests. More...

Inheritance diagram for Satori.HttpRequestAdapter:
Satori.IHttpAdapter

Public Member Functions

 HttpRequestAdapter (HttpClient httpClient)
 
async Task< string > SendAsync (string method, Uri uri, IDictionary< string, string > headers, byte[] body, int timeout, CancellationToken? userCancelToken)
 Send a HTTP request.
Parameters
methodHTTP method to use for this request.
uriThe fully qualified URI to use.
headersRequest headers to set.
bodyRequest content body to set.
timeoutSecRequest timeout.
userCancelTokenA user-generated token that can be used to cancel the request.
Returns
A task which resolves to the contents of the response.

 

Static Public Member Functions

static IHttpAdapter WithGzip (bool decompression=false, bool compression=false)
 A new HTTP adapter with configuration for gzip support in the underlying HTTP client.
 

Properties

ILogger Logger [get, set]
 The logger to use with the adapter.
 
TransientExceptionDelegate TransientExceptionDelegate [get]
 A delegate used to determine whether or not an error from the server is due to a temporary bad state on the server (i.e., is 'transient').
 
- Properties inherited from Satori.IHttpAdapter

Detailed Description

HTTP Request adapter which uses the .NET HttpClient to send requests.

Accept header is always set as 'application/json'.

Constructor & Destructor Documentation

◆ HttpRequestAdapter()

Satori.HttpRequestAdapter.HttpRequestAdapter ( HttpClient  httpClient)
inline

Member Function Documentation

◆ SendAsync()

async Task< string > Satori.HttpRequestAdapter.SendAsync ( string  method,
Uri  uri,
IDictionary< string, string >  headers,
byte[]  body,
int  timeout,
CancellationToken?  userCancelToken 
)
inline

Send a HTTP request.

Parameters
methodHTTP method to use for this request.
uriThe fully qualified URI to use.
headersRequest headers to set.
bodyRequest content body to set.
timeoutSecRequest timeout.
userCancelTokenA user-generated token that can be used to cancel the request.
Returns
A task which resolves to the contents of the response.

Implements Satori.IHttpAdapter.

◆ WithGzip()

static IHttpAdapter Satori.HttpRequestAdapter.WithGzip ( bool  decompression = false,
bool  compression = false 
)
inlinestatic

A new HTTP adapter with configuration for gzip support in the underlying HTTP client.

NOTE Decompression does not work with Mono AOT on Android.

Parameters
decompressionIf automatic decompression should be enabled with the HTTP adapter.
compressionIf automatic compression should be enabled with the HTTP adapter.
Returns
A new HTTP adapter.

Property Documentation

◆ Logger

ILogger Satori.HttpRequestAdapter.Logger
getset

The logger to use with the adapter.

Implements Satori.IHttpAdapter.

◆ TransientExceptionDelegate

TransientExceptionDelegate Satori.HttpRequestAdapter.TransientExceptionDelegate
get

A delegate used to determine whether or not an error from the server is due to a temporary bad state on the server (i.e., is 'transient').

Implements Satori.IHttpAdapter.


The documentation for this class was generated from the following file: