HTTP Request adapter which uses the .NET HttpClient to send requests.
More...
|
| 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
-
method | HTTP method to use for this request. |
uri | The fully qualified URI to use. |
headers | Request headers to set. |
body | Request content body to set. |
timeoutSec | Request timeout. |
userCancelToken | A user-generated token that can be used to cancel the request. |
- Returns
- A task which resolves to the contents of the response.
|
|
|
static IHttpAdapter | WithGzip (bool decompression=false, bool compression=false) |
| A new HTTP adapter with configuration for gzip support in the underlying HTTP client.
|
|
|
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').
|
|
HTTP Request adapter which uses the .NET HttpClient to send requests.
Accept header is always set as 'application/json'.
◆ HttpRequestAdapter()
Satori.HttpRequestAdapter.HttpRequestAdapter |
( |
HttpClient |
httpClient | ) |
|
|
inline |
◆ 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
-
method | HTTP method to use for this request. |
uri | The fully qualified URI to use. |
headers | Request headers to set. |
body | Request content body to set. |
timeoutSec | Request timeout. |
userCancelToken | A 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
-
decompression | If automatic decompression should be enabled with the HTTP adapter. |
compression | If automatic compression should be enabled with the HTTP adapter. |
- Returns
- A new HTTP adapter.
◆ Logger
ILogger Satori.HttpRequestAdapter.Logger |
|
getset |
◆ 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: