<PackageReference Include="Microsoft.Net.Http" Version="2.2.13" />

System.Net.Http.HttpClient

Provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI.
public Uri BaseAddress { get; set; }

Gets or sets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests.

Gets the headers which should be sent with each request.

public long MaxResponseContentBufferSize { get; set; }

Gets or sets the maximum number of bytes to buffer when reading the response content.

public TimeSpan Timeout { get; set; }

Gets or sets the number of milliseconds to wait before the request times out.

public HttpClient()

Initializes a new instance of the HttpClient class.

Initializes a new instance of the HttpClient class with a specific handler.

public HttpClient(HttpMessageHandler handler, bool disposeHandler)

public void CancelPendingRequests()

Cancel all pending requests on this instance.

public Task<HttpResponseMessage> DeleteAsync(string requestUri)

Send a DELETE request to the specified Uri as an asynchronous operation.

Send a DELETE request to the specified Uri as an asynchronous operation.

public Task<HttpResponseMessage> DeleteAsync(string requestUri, CancellationToken cancellationToken)

public Task<HttpResponseMessage> DeleteAsync(Uri requestUri, CancellationToken cancellationToken)

public Task<HttpResponseMessage> GetAsync(string requestUri)

Send a GET request to the specified Uri as an asynchronous operation.

public Task<HttpResponseMessage> GetAsync(Uri requestUri)

Send a GET request to the specified Uri as an asynchronous operation.

public Task<HttpResponseMessage> GetAsync(string requestUri, HttpCompletionOption completionOption)

public Task<HttpResponseMessage> GetAsync(Uri requestUri, HttpCompletionOption completionOption)

public Task<HttpResponseMessage> GetAsync(string requestUri, CancellationToken cancellationToken)

public Task<HttpResponseMessage> GetAsync(Uri requestUri, CancellationToken cancellationToken)

public Task<HttpResponseMessage> GetAsync(string requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken)

public Task<HttpResponseMessage> GetAsync(Uri requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken)

public Task<byte[]> GetByteArrayAsync(string requestUri)

public Task<byte[]> GetByteArrayAsync(Uri requestUri)

public Task<Stream> GetStreamAsync(string requestUri)

public Task<Stream> GetStreamAsync(Uri requestUri)

public Task<string> GetStringAsync(string requestUri)

public Task<string> GetStringAsync(Uri requestUri)

public Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content)

Send a POST request to the specified Uri as an asynchronous operation.

public Task<HttpResponseMessage> PostAsync(Uri requestUri, HttpContent content)

Send a POST request to the specified Uri as an asynchronous operation.

public Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content, CancellationToken cancellationToken)

public Task<HttpResponseMessage> PostAsync(Uri requestUri, HttpContent content, CancellationToken cancellationToken)

public Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content)

Send a PUT request to the specified Uri as an asynchronous operation.

public Task<HttpResponseMessage> PutAsync(Uri requestUri, HttpContent content)

Send a PUT request to the specified Uri as an asynchronous operation.

public Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content, CancellationToken cancellationToken)

public Task<HttpResponseMessage> PutAsync(Uri requestUri, HttpContent content, CancellationToken cancellationToken)

Send an HTTP request as an asynchronous operation.

Send an HTTP request as an asynchronous operation.

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

Send an HTTP request as an asynchronous operation.