Table of Contents

Interface IThirdwebHttpClient

Namespace
Thirdweb
Assembly
Thirdweb.dll

Interface for a HTTP client used in the Thirdweb SDK.

public interface IThirdwebHttpClient : IDisposable
Inherited Members

Properties

Headers

Gets the headers for the HTTP client.

Dictionary<string, string> Headers { get; }

Property Value

Dictionary<string, string>

Methods

AddHeader(string, string)

Adds a header to the HTTP client.

void AddHeader(string key, string value)

Parameters

key string

The header key.

value string

The header value.

ClearHeaders()

Clears all headers from the HTTP client.

void ClearHeaders()

DeleteAsync(string, CancellationToken)

Sends a DELETE request to the specified URI.

Task<ThirdwebHttpResponseMessage> DeleteAsync(string requestUri, CancellationToken cancellationToken = default)

Parameters

requestUri string

The request URI.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ThirdwebHttpResponseMessage>

A task that represents the asynchronous operation. The task result contains the HTTP response message.

GetAsync(string, CancellationToken)

Sends a GET request to the specified URI.

Task<ThirdwebHttpResponseMessage> GetAsync(string requestUri, CancellationToken cancellationToken = default)

Parameters

requestUri string

The request URI.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ThirdwebHttpResponseMessage>

A task that represents the asynchronous operation. The task result contains the HTTP response message.

PostAsync(string, HttpContent, CancellationToken)

Sends a POST request to the specified URI.

Task<ThirdwebHttpResponseMessage> PostAsync(string requestUri, HttpContent content, CancellationToken cancellationToken = default)

Parameters

requestUri string

The request URI.

content HttpContent

The HTTP content to send.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ThirdwebHttpResponseMessage>

A task that represents the asynchronous operation. The task result contains the HTTP response message.

PutAsync(string, HttpContent, CancellationToken)

Sends a PUT request to the specified URI.

Task<ThirdwebHttpResponseMessage> PutAsync(string requestUri, HttpContent content, CancellationToken cancellationToken = default)

Parameters

requestUri string

The request URI.

content HttpContent

The HTTP content to send.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ThirdwebHttpResponseMessage>

A task that represents the asynchronous operation. The task result contains the HTTP response message.

RemoveHeader(string)

Removes a header from the HTTP client.

void RemoveHeader(string key)

Parameters

key string

The header key.

SetHeaders(Dictionary<string, string>)

Sets the headers for the HTTP client.

void SetHeaders(Dictionary<string, string> headers)

Parameters

headers Dictionary<string, string>

The headers to set.