Table of Contents

Class ThirdwebHttpClientWrapper

Namespace
Thirdweb.Api
Assembly
Thirdweb.dll

Wrapper class that adapts IThirdwebHttpClient to work with System.Net.Http.HttpClient expectations

public class ThirdwebHttpClientWrapper : HttpClient, IDisposable
Inheritance
ThirdwebHttpClientWrapper
Implements
Inherited Members

Constructors

ThirdwebHttpClientWrapper(IThirdwebHttpClient)

public ThirdwebHttpClientWrapper(IThirdwebHttpClient thirdwebClient)

Parameters

thirdwebClient IThirdwebHttpClient

Methods

SendAsync(HttpRequestMessage, HttpCompletionOption, CancellationToken)

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

Parameters

request HttpRequestMessage
completionOption HttpCompletionOption
cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>

SendAsync(HttpRequestMessage, CancellationToken)

Send an HTTP request as an asynchronous operation.

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

Parameters

request HttpRequestMessage

The HTTP request message to send.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<HttpResponseMessage>

The task object representing the asynchronous operation.

Exceptions

ArgumentNullException

The request is null.

InvalidOperationException

The request message was already sent by the HttpClient instance.

HttpRequestException

The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.