HttpClientExtensions.PutAsJsonAsync 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 PutAsJsonAsync<T>(HttpClient, String, T)

System_CAPS_pubmethodSystem_CAPS_static PutAsJsonAsync<T>(HttpClient, String, T, CancellationToken)

System_CAPS_pubmethodSystem_CAPS_static PutAsJsonAsync<T>(HttpClient, Uri, T)

Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON.

System_CAPS_pubmethodSystem_CAPS_static PutAsJsonAsync<T>(HttpClient, Uri, T, CancellationToken)

Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON.

See Also

HttpClientExtensions Class
System.Net.Http Namespace

Return to top

HttpClientExtensions.PutAsJsonAsync<T> Method (HttpClient, String, T)

Syntax

public static Task<HttpResponseMessage> PutAsJsonAsync<T>(
    this HttpClient client,
    string requestUri,
    T value
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsJsonAsync(
    HttpClient^ client,
    String^ requestUri,
    T value
)
static member PutAsJsonAsync<'T> : 
        client:HttpClient *
        requestUri:string *
        value:'T -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsJsonAsync(Of T) (
    client As HttpClient,
    requestUri As String,
    value As T
) As Task(Of HttpResponseMessage)

Parameters

  • value
    Type: T

Return Value

Type: System.Threading.Tasks.Task<HttpResponseMessage>

Type Parameters

  • T

Return to top

HttpClientExtensions.PutAsJsonAsync<T> Method (HttpClient, String, T, CancellationToken)

Syntax

public static Task<HttpResponseMessage> PutAsJsonAsync<T>(
    this HttpClient client,
    string requestUri,
    T value,
    CancellationToken cancellationToken
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsJsonAsync(
    HttpClient^ client,
    String^ requestUri,
    T value,
    CancellationToken cancellationToken
)
static member PutAsJsonAsync<'T> : 
        client:HttpClient *
        requestUri:string *
        value:'T *
        cancellationToken:CancellationToken -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsJsonAsync(Of T) (
    client As HttpClient,
    requestUri As String,
    value As T,
    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.PutAsJsonAsync<T> Method (HttpClient, Uri, T)

Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON.

Syntax

public static Task<HttpResponseMessage> PutAsJsonAsync<T>(
    this HttpClient client,
    Uri requestUri,
    T value
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsJsonAsync(
    HttpClient^ client,
    Uri^ requestUri,
    T value
)
static member PutAsJsonAsync<'T> : 
        client:HttpClient *
        requestUri:Uri *
        value:'T -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsJsonAsync(Of T) (
    client As HttpClient,
    requestUri As Uri,
    value As T
) 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.PutAsJsonAsync<T> Method (HttpClient, Uri, T, CancellationToken)

Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON.

Syntax

public static Task<HttpResponseMessage> PutAsJsonAsync<T>(
    this HttpClient client,
    Uri requestUri,
    T value,
    CancellationToken cancellationToken
)
public:
generic<typename T>
[ExtensionAttribute]
static Task<HttpResponseMessage^>^ PutAsJsonAsync(
    HttpClient^ client,
    Uri^ requestUri,
    T value,
    CancellationToken cancellationToken
)
static member PutAsJsonAsync<'T> : 
        client:HttpClient *
        requestUri:Uri *
        value:'T *
        cancellationToken:CancellationToken -> Task<HttpResponseMessage>
<ExtensionAttribute>
Public Shared Function PutAsJsonAsync(Of T) (
    client As HttpClient,
    requestUri As Uri,
    value As T,
    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