Nakama .NET 3.1.1
.NET client for Nakama server written in C
Nakama.HttpRequestAdapter Class Reference

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

Inheritance diagram for Nakama.HttpRequestAdapter:
Nakama.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. More...
 

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. More...
 

Properties

ILogger Logger [getset]
 
- Properties inherited from Nakama.IHttpAdapter
ILogger Logger [getset]
 The logger to use with the adapter. More...
 

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()

Nakama.HttpRequestAdapter.HttpRequestAdapter ( HttpClient  httpClient)
inline

Member Function Documentation

◆ SendAsync()

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

Send a HTTP request.

Implements Nakama.IHttpAdapter.

◆ WithGzip()

static IHttpAdapter Nakama.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 Nakama.HttpRequestAdapter.Logger
getset


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