Class ThirdwebHttpClientWrapper
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
HttpRequestMessagecompletionOption
HttpCompletionOptioncancellationToken
CancellationToken
Returns
SendAsync(HttpRequestMessage, CancellationToken)
Send an HTTP request as an asynchronous operation.
public override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
request
HttpRequestMessageThe HTTP request message to send.
cancellationToken
CancellationTokenThe 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.