Share via


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

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

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

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

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

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

See Also

HttpClientExtensions Class
System.Net.Http Namespace

Return to top

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

Syntax

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

Syntax

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

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

Syntax

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

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

Syntax

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