HttpClient.PutAsync(Uri, IHttpContent) HttpClient.PutAsync(Uri, IHttpContent) HttpClient.PutAsync(Uri, IHttpContent) HttpClient.PutAsync(Uri, IHttpContent) HttpClient.PutAsync(Uri, IHttpContent) Method

Definition

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

public : IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress> PutAsync(Uri uri, IHttpContent content)
IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress> PutAsync(Uri uri, IHttpContent content) const;
public IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress> PutAsync(Uri uri, IHttpContent content)
Public Function PutAsync(uri As Uri, content As IHttpContent) As IAsyncOperationWithProgress(Of HttpResponseMessageHttpProgress)
Windows.Web.Http.HttpClient.putAsync(uri, content).done( /* Your success and error handlers */ );

Parameters

uri
Uri Uri Uri

The Uri the request is sent to.

content
IHttpContent IHttpContent IHttpContent

The HTTP request content to send to the server.

Returns

Remarks

This operation will not block. The returned IAsyncOperationWithProgress(HttpResponseMessage, HttpProgress) object will complete after the whole response (including content) is read.

The PutAsync and PostAsync methods only allow setting a limited number of HTTP content headers. In contrast, the SendRequestAsync method allows setting headers on the request message as well as on the HTTP content to be sent.

Below are the exceptions that this function throws.

E_INVALIDARG

The uri parameter was a null reference (Nothing in Visual Basic).

See also