A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.putasync below:

HttpClient.PutAsync Method (System.Net.Http) | Microsoft Learn

HttpClient.PutAsync Method Definition

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

Overloads

This operation doesn't block.

PutAsync(String, HttpContent)
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs

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

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PutAsync(System::String ^ requestUri, System::Net::Http::HttpContent ^ content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string requestUri, System.Net.Http.HttpContent content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string? requestUri, System.Net.Http.HttpContent? content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string? requestUri, System.Net.Http.HttpContent content);
member this.PutAsync : string * System.Net.Http.HttpContent -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function PutAsync (requestUri As String, content As HttpContent) As Task(Of HttpResponseMessage)
Parameters
requestUri
String

The URI the request is sent to.

content
HttpContent

The HTTP request content sent to the server.

Returns

The task object representing the asynchronous operation.

Exceptions

The requestUri is not an absolute URI and BaseAddress isn't set.

The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by HttpRequestError

-or-

.NET Framework only: The request timed out.

.NET Core and .NET 5 and later only: The request failed due to timeout.

The provided request URI is not valid relative or absolute URI.

Remarks

This operation doesn't block. The returned Task<TResult> object will complete after the whole response (including content) is read.

PutAsync(Uri, HttpContent)
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs

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

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PutAsync(Uri ^ requestUri, System::Net::Http::HttpContent ^ content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(Uri requestUri, System.Net.Http.HttpContent content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(Uri? requestUri, System.Net.Http.HttpContent? content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(Uri? requestUri, System.Net.Http.HttpContent content);
member this.PutAsync : Uri * System.Net.Http.HttpContent -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function PutAsync (requestUri As Uri, content As HttpContent) As Task(Of HttpResponseMessage)
Parameters
requestUri
Uri

The URI the request is sent to.

content
HttpContent

The HTTP request content sent to the server.

Returns

The task object representing the asynchronous operation.

Exceptions

The requestUri is not an absolute URI and BaseAddress isn't set.

The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by HttpRequestError

-or-

.NET Framework only: The request timed out.

.NET Core and .NET 5 and later only: The request failed due to timeout.

Remarks

This operation doesn't block. The returned Task<TResult> object will complete after the whole response (including content) is read.

PutAsync(String, HttpContent, CancellationToken)
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs

Send a PUT request with a cancellation token as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PutAsync(System::String ^ requestUri, System::Net::Http::HttpContent ^ content, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string requestUri, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(string? requestUri, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken);
member this.PutAsync : string * System.Net.Http.HttpContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function PutAsync (requestUri As String, content As HttpContent, cancellationToken As CancellationToken) As Task(Of HttpResponseMessage)
Parameters
requestUri
String

The URI the request is sent to.

content
HttpContent

The HTTP request content sent to the server.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

The task object representing the asynchronous operation.

Exceptions

The requestUri is not an absolute URI and BaseAddress isn't set.

The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by HttpRequestError

-or-

.NET Framework only: The request timed out.

The provided request URI is not valid relative or absolute URI.

The cancellation token was canceled. This exception is stored into the returned task.

-or-

.NET Core and .NET 5 and later only: The request failed due to timeout.

Remarks

This operation doesn't block. The returned Task<TResult> object will complete after the whole response (including content) is read.

PutAsync(Uri, HttpContent, CancellationToken)
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs

Send a PUT request with a cancellation token as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PutAsync(Uri ^ requestUri, System::Net::Http::HttpContent ^ content, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(Uri requestUri, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(Uri? requestUri, System.Net.Http.HttpContent? content, System.Threading.CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PutAsync(Uri? requestUri, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken);
member this.PutAsync : Uri * System.Net.Http.HttpContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function PutAsync (requestUri As Uri, content As HttpContent, cancellationToken As CancellationToken) As Task(Of HttpResponseMessage)
Parameters
requestUri
Uri

The URI the request is sent to.

content
HttpContent

The HTTP request content sent to the server.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

The task object representing the asynchronous operation.

Exceptions

The requestUri is not an absolute URI and BaseAddress isn't set.

The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by HttpRequestError

-or-

.NET Framework only: The request timed out.

The cancellation token was canceled. This exception is stored into the returned task.

-or-

.NET Core and .NET 5 and later only: The request failed due to timeout.

Remarks

This operation doesn't block. The returned Task<TResult> object will complete after the whole response (including content) is read.

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4