Share via


HttpClientExtensions.PutAsync Method

 

Namespace:   System.Net.Http
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static PutAsync<T>(HttpClient, String, T, MediaTypeFormatter)

System_CAPS_pubmethodSystem_CAPS_static PutAsync<T>(HttpClient, String, T, MediaTypeFormatter, CancellationToken)

System_CAPS_pubmethodSystem_CAPS_static PutAsync<T>(HttpClient, String, T, MediaTypeFormatter, MediaTypeHeaderValue, CancellationToken)

System_CAPS_pubmethodSystem_CAPS_static PutAsync<T>(HttpClient, String, T, MediaTypeFormatter, String)

System_CAPS_pubmethodSystem_CAPS_static PutAsync<T>(HttpClient, String, T, MediaTypeFormatter, String, CancellationToken)

System_CAPS_pubmethodSystem_CAPS_static 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.

System_CAPS_pubmethodSystem_CAPS_static 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.

System_CAPS_pubmethodSystem_CAPS_static 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.

System_CAPS_pubmethodSystem_CAPS_static 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.

System_CAPS_pubmethodSystem_CAPS_static 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

  • value
    Type: T

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

  • value
    Type: T

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

  • value
    Type: T

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

  • value
    Type: T

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

  • value
    Type: T

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

  • requestUri
    Type: System.Uri

    The Uri the request is sent to.

  • value
    Type: T

    The value that will be placed in the request's entity body.

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

  • requestUri
    Type: System.Uri

    The Uri the request is sent to.

  • value
    Type: T

    The value that will be placed in the request's entity body.

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

  • requestUri
    Type: System.Uri

    The Uri the request is sent to.

  • value
    Type: T

    The value that will be placed in the request's entity body.

  • mediaType
    Type: System.Net.Http.Headers.MediaTypeHeaderValue

    The 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)

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

  • requestUri
    Type: System.Uri

    The Uri the request is sent to.

  • value
    Type: T

    The value that will be placed in the request's entity body.

  • mediaType
    Type: System.String

    The 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

  • requestUri
    Type: System.Uri

    The Uri the request is sent to.

  • value
    Type: T

    The value that will be placed in the request's entity body.

  • mediaType
    Type: System.String

    The 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