HttpClientExtensions.PutAsync Method
Namespace: System.Net.Http
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Overload List
Name | Description | |
---|---|---|
PutAsync<T>(HttpClient, String, T, MediaTypeFormatter) | ||
PutAsync<T>(HttpClient, String, T, MediaTypeFormatter, CancellationToken) | ||
PutAsync<T>(HttpClient, String, T, MediaTypeFormatter, MediaTypeHeaderValue, CancellationToken) | ||
PutAsync<T>(HttpClient, String, T, MediaTypeFormatter, String) | ||
PutAsync<T>(HttpClient, String, T, MediaTypeFormatter, String, CancellationToken) | ||
PutAsync<T>(HttpClient, Uri, T, MediaTypeFormatter) | Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. |
|
PutAsync<T>(HttpClient, Uri, T, MediaTypeFormatter, CancellationToken) | Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. |
|
PutAsync<T>(HttpClient, Uri, T, MediaTypeFormatter, MediaTypeHeaderValue, CancellationToken) | Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. |
|
PutAsync<T>(HttpClient, Uri, T, MediaTypeFormatter, String) | Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. |
|
PutAsync<T>(HttpClient, Uri, T, MediaTypeFormatter, String, CancellationToken) | Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. |
See Also
HttpClientExtensions Class
System.Net.Http Namespace
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, String, T, MediaTypeFormatter)
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
string requestUri,
T value,
MediaTypeFormatter formatter
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
String^ requestUri,
T value,
MediaTypeFormatter^ formatter
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:string *
value:'T *
formatter:MediaTypeFormatter -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As String,
value As T,
formatter As MediaTypeFormatter
) As Task(Of HttpResponseMessage)
Parameters
- client
Type: System.Net.Http.HttpClient
- requestUri
Type: System.String
- value
Type: T
- formatter
Type: System.Net.Http.Formatting.MediaTypeFormatter
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
Type Parameters
- T
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, String, T, MediaTypeFormatter, CancellationToken)
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
string requestUri,
T value,
MediaTypeFormatter formatter,
CancellationToken cancellationToken
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
String^ requestUri,
T value,
MediaTypeFormatter^ formatter,
CancellationToken cancellationToken
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:string *
value:'T *
formatter:MediaTypeFormatter *
cancellationToken:CancellationToken -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As String,
value As T,
formatter As MediaTypeFormatter,
cancellationToken As CancellationToken
) As Task(Of HttpResponseMessage)
Parameters
- client
Type: System.Net.Http.HttpClient
- requestUri
Type: System.String
- value
Type: T
- formatter
Type: System.Net.Http.Formatting.MediaTypeFormatter
- cancellationToken
Type: System.Threading.CancellationToken
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
Type Parameters
- T
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, String, T, MediaTypeFormatter, MediaTypeHeaderValue, CancellationToken)
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
string requestUri,
T value,
MediaTypeFormatter formatter,
MediaTypeHeaderValue mediaType,
CancellationToken cancellationToken
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
String^ requestUri,
T value,
MediaTypeFormatter^ formatter,
MediaTypeHeaderValue^ mediaType,
CancellationToken cancellationToken
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:string *
value:'T *
formatter:MediaTypeFormatter *
mediaType:MediaTypeHeaderValue *
cancellationToken:CancellationToken -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As String,
value As T,
formatter As MediaTypeFormatter,
mediaType As MediaTypeHeaderValue,
cancellationToken As CancellationToken
) As Task(Of HttpResponseMessage)
Parameters
- client
Type: System.Net.Http.HttpClient
- requestUri
Type: System.String
- value
Type: T
- formatter
Type: System.Net.Http.Formatting.MediaTypeFormatter
- mediaType
Type: System.Net.Http.Headers.MediaTypeHeaderValue
- cancellationToken
Type: System.Threading.CancellationToken
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
Type Parameters
- T
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, String, T, MediaTypeFormatter, String)
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
string requestUri,
T value,
MediaTypeFormatter formatter,
string mediaType
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
String^ requestUri,
T value,
MediaTypeFormatter^ formatter,
String^ mediaType
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:string *
value:'T *
formatter:MediaTypeFormatter *
mediaType:string -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As String,
value As T,
formatter As MediaTypeFormatter,
mediaType As String
) As Task(Of HttpResponseMessage)
Parameters
- client
Type: System.Net.Http.HttpClient
- requestUri
Type: System.String
- value
Type: T
- formatter
Type: System.Net.Http.Formatting.MediaTypeFormatter
- mediaType
Type: System.String
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
Type Parameters
- T
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, String, T, MediaTypeFormatter, String, CancellationToken)
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
string requestUri,
T value,
MediaTypeFormatter formatter,
string mediaType,
CancellationToken cancellationToken
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
String^ requestUri,
T value,
MediaTypeFormatter^ formatter,
String^ mediaType,
CancellationToken cancellationToken
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:string *
value:'T *
formatter:MediaTypeFormatter *
mediaType:string *
cancellationToken:CancellationToken -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As String,
value As T,
formatter As MediaTypeFormatter,
mediaType As String,
cancellationToken As CancellationToken
) As Task(Of HttpResponseMessage)
Parameters
- client
Type: System.Net.Http.HttpClient
- requestUri
Type: System.String
- value
Type: T
- formatter
Type: System.Net.Http.Formatting.MediaTypeFormatter
- mediaType
Type: System.String
- cancellationToken
Type: System.Threading.CancellationToken
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
Type Parameters
- T
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, Uri, T, MediaTypeFormatter)
Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter.
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
Uri requestUri,
T value,
MediaTypeFormatter formatter
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
Uri^ requestUri,
T value,
MediaTypeFormatter^ formatter
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:Uri *
value:'T *
formatter:MediaTypeFormatter -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As Uri,
value As T,
formatter As MediaTypeFormatter
) As Task(Of HttpResponseMessage)
Parameters
client
Type: System.Net.Http.HttpClientThe client used to make the request.
requestUri
Type: System.UriThe Uri the request is sent to.
value
Type: TThe value that will be placed in the request's entity body.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter used to serialize the value.
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
A task object representing the asynchronous operation.
Type Parameters
- T
The type of value.
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, Uri, T, MediaTypeFormatter, CancellationToken)
Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter.
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
Uri requestUri,
T value,
MediaTypeFormatter formatter,
CancellationToken cancellationToken
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
Uri^ requestUri,
T value,
MediaTypeFormatter^ formatter,
CancellationToken cancellationToken
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:Uri *
value:'T *
formatter:MediaTypeFormatter *
cancellationToken:CancellationToken -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As Uri,
value As T,
formatter As MediaTypeFormatter,
cancellationToken As CancellationToken
) As Task(Of HttpResponseMessage)
Parameters
client
Type: System.Net.Http.HttpClientThe client used to make the request.
requestUri
Type: System.UriThe Uri the request is sent to.
value
Type: TThe value that will be placed in the request's entity body.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter used to serialize the value.
cancellationToken
Type: System.Threading.CancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
A task object representing the asynchronous operation.
Type Parameters
- T
The type of value.
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, Uri, T, MediaTypeFormatter, MediaTypeHeaderValue, CancellationToken)
Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter.
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
Uri requestUri,
T value,
MediaTypeFormatter formatter,
MediaTypeHeaderValue mediaType,
CancellationToken cancellationToken
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
Uri^ requestUri,
T value,
MediaTypeFormatter^ formatter,
MediaTypeHeaderValue^ mediaType,
CancellationToken cancellationToken
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:Uri *
value:'T *
formatter:MediaTypeFormatter *
mediaType:MediaTypeHeaderValue *
cancellationToken:CancellationToken -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As Uri,
value As T,
formatter As MediaTypeFormatter,
mediaType As MediaTypeHeaderValue,
cancellationToken As CancellationToken
) As Task(Of HttpResponseMessage)
Parameters
client
Type: System.Net.Http.HttpClientThe client used to make the request.
requestUri
Type: System.UriThe Uri the request is sent to.
value
Type: TThe value that will be placed in the request's entity body.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter used to serialize the value.
mediaType
Type: System.Net.Http.Headers.MediaTypeHeaderValueThe authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used.
cancellationToken
Type: System.Threading.CancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
A task object representing the asynchronous operation.
Type Parameters
- T
The type of value.
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, Uri, T, MediaTypeFormatter, String)
Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter.
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
Uri requestUri,
T value,
MediaTypeFormatter formatter,
string mediaType
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
Uri^ requestUri,
T value,
MediaTypeFormatter^ formatter,
String^ mediaType
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:Uri *
value:'T *
formatter:MediaTypeFormatter *
mediaType:string -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As Uri,
value As T,
formatter As MediaTypeFormatter,
mediaType As String
) As Task(Of HttpResponseMessage)
Parameters
client
Type: System.Net.Http.HttpClientThe client used to make the request.
requestUri
Type: System.UriThe Uri the request is sent to.
value
Type: TThe value that will be placed in the request's entity body.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter used to serialize the value.
mediaType
Type: System.StringThe authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used.
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
A task object representing the asynchronous operation.
Type Parameters
- T
The type of value.
Return to top
HttpClientExtensions.PutAsync<T> Method (HttpClient, Uri, T, MediaTypeFormatter, String, CancellationToken)
Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter.
Syntax
public static Task<HttpResponseMessage> PutAsync<T>(
this HttpClient client,
Uri requestUri,
T value,
MediaTypeFormatter formatter,
string mediaType,
CancellationToken cancellationToken
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsync(
HttpClient^ client,
Uri^ requestUri,
T value,
MediaTypeFormatter^ formatter,
String^ mediaType,
CancellationToken cancellationToken
)
static member PutAsync<'T> :
client:HttpClient *
requestUri:Uri *
value:'T *
formatter:MediaTypeFormatter *
mediaType:string *
cancellationToken:CancellationToken -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsync(Of T) (
client As HttpClient,
requestUri As Uri,
value As T,
formatter As MediaTypeFormatter,
mediaType As String,
cancellationToken As CancellationToken
) As Task(Of HttpResponseMessage)
Parameters
client
Type: System.Net.Http.HttpClientThe client used to make the request.
requestUri
Type: System.UriThe Uri the request is sent to.
value
Type: TThe value that will be placed in the request's entity body.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe formatter used to serialize the value.
mediaType
Type: System.StringThe authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used.
cancellationToken
Type: System.Threading.CancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Return Value
Type: System.Threading.Tasks.Task<HttpResponseMessage>
A task object representing the asynchronous operation.
Type Parameters
- T
The type of value.
Return to top