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
Methods
AddHeader(string, string)
Adds a header to the HTTP client.
void AddHeader(string key, string value)
Parameters
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
stringThe request URI.
cancellationToken
CancellationTokenThe 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
stringThe request URI.
cancellationToken
CancellationTokenThe 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
stringThe request URI.
content
HttpContentThe HTTP content to send.
cancellationToken
CancellationTokenThe 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
stringThe request URI.
content
HttpContentThe HTTP content to send.
cancellationToken
CancellationTokenThe 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
stringThe 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.