WasiHostHttpClient Class
- Not supported on browser
An HTTP client that sends the requests over the network of the machine (SocketsHttpHandler), with the rules of a WasiHostHttpClientOptions.
[UnsupportedOSPlatform("browser")]
public sealed class WasiHostHttpClient : WasiHttpClient, IDisposableRemarks
The client does not follow the redirections, does not decompress the contents, does not keep cookies and does not use a proxy: the component receives the responses of the servers as they are. It is not supported on the browser.
- Inheritance
WasiHttpClientWasiHostHttpClient- Implements
Constructors
| Name | Description |
|---|---|
| WasiHostHttpClient(WasiHostHttpClientOptions) | Initializes a new instance of the WasiHostHttpClient class. |
WasiHostHttpClient(WasiHostHttpClientOptions)
WasiHttpClient.csInitializes a new instance of the WasiHostHttpClient class.
public WasiHostHttpClient(WasiHostHttpClientOptions options)Parameters
optionsWasiHostHttpClientOptions- The rules of the client.
Methods
| Name | Description |
|---|---|
| Dispose() | Closes the connections of the client. |
| SendAsync(HttpRequestMessage, CancellationToken) | Sends a request, and returns the response once its headers are received. |
Dispose()
WasiHttpClient.csCloses the connections of the client.
public void Dispose()SendAsync(HttpRequestMessage, CancellationToken)
WasiHttpClient.csSends a request, and returns the response once its headers are received.
public override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)Parameters
requestHttpRequestMessage- The request.
cancellationTokenCancellationToken- The token that is cancelled when the component cancels the request.
Returns
Task<HttpResponseMessage> The response.