-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathIThirdwebHttpClient.cs
More file actions
70 lines (61 loc) · 3.02 KB
/
Copy pathIThirdwebHttpClient.cs
File metadata and controls
70 lines (61 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
namespace Thirdweb;
/// <summary>
/// Interface for a HTTP client used in the Thirdweb SDK.
/// </summary>
public interface IThirdwebHttpClient : IDisposable
{
/// <summary>
/// Gets the headers for the HTTP client.
/// </summary>
public Dictionary<string, string> Headers { get; }
/// <summary>
/// Sets the headers for the HTTP client.
/// </summary>
/// <param name="headers">The headers to set.</param>
public void SetHeaders(Dictionary<string, string> headers);
/// <summary>
/// Clears all headers from the HTTP client.
/// </summary>
public void ClearHeaders();
/// <summary>
/// Adds a header to the HTTP client.
/// </summary>
/// <param name="key">The header key.</param>
/// <param name="value">The header value.</param>
public void AddHeader(string key, string value);
/// <summary>
/// Removes a header from the HTTP client.
/// </summary>
/// <param name="key">The header key.</param>
public void RemoveHeader(string key);
/// <summary>
/// Sends a GET request to the specified URI.
/// </summary>
/// <param name="requestUri">The request URI.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the HTTP response message.</returns>
public Task<ThirdwebHttpResponseMessage> GetAsync(string requestUri, CancellationToken cancellationToken = default);
/// <summary>
/// Sends a POST request to the specified URI.
/// </summary>
/// <param name="requestUri">The request URI.</param>
/// <param name="content">The HTTP content to send.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the HTTP response message.</returns>
public Task<ThirdwebHttpResponseMessage> PostAsync(string requestUri, HttpContent content, CancellationToken cancellationToken = default);
/// <summary>
/// Sends a PUT request to the specified URI.
/// </summary>
/// <param name="requestUri">The request URI.</param>
/// <param name="content">The HTTP content to send.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the HTTP response message.</returns>
public Task<ThirdwebHttpResponseMessage> PutAsync(string requestUri, HttpContent content, CancellationToken cancellationToken = default);
/// <summary>
/// Sends a DELETE request to the specified URI.
/// </summary>
/// <param name="requestUri">The request URI.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the HTTP response message.</returns>
public Task<ThirdwebHttpResponseMessage> DeleteAsync(string requestUri, CancellationToken cancellationToken = default);
}