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, IDisposable

Remarks

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
WasiHttpClient WasiHostHttpClient
Implements

Constructors

NameDescription
WasiHostHttpClient(WasiHostHttpClientOptions)Initializes a new instance of the WasiHostHttpClient class.

WasiHostHttpClient(WasiHostHttpClientOptions)

WasiHttpClient.cs

Initializes a new instance of the WasiHostHttpClient class.

public WasiHostHttpClient(WasiHostHttpClientOptions options)

Parameters

options WasiHostHttpClientOptions
The rules of the client.

Methods

NameDescription
Dispose()Closes the connections of the client.
SendAsync(HttpRequestMessage, CancellationToken)Sends a request, and returns the response once its headers are received.

Closes the connections of the client.

public void Dispose()

SendAsync(HttpRequestMessage, CancellationToken)

WasiHttpClient.cs

Sends a request, and returns the response once its headers are received.

public override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)

Parameters

request HttpRequestMessage
The request.
cancellationToken CancellationToken
The token that is cancelled when the component cancels the request.

Returns

Task<HttpResponseMessage> The response.