Class HttpClientExtensions
Inherited Members
Namespace: P42.Utils
Assembly: P42.Utils.dll
Syntax
public static class HttpClientExtensions
Properties
| Improve this Doc View SourcePatch
Need to make this more clear
Declaration
public static HttpMethod Patch { get; }
Property Value
Type | Description |
---|---|
HttpMethod | The patch. |
Methods
| Improve this Doc View SourcePatchAsync(HttpClient, String, HttpContent)
Send a PATCH request to the specified Uri as an asynchronous operation.
Declaration
public static Task<HttpResponseMessage> PatchAsync(this HttpClient client, string requestUri, HttpContent content)
Parameters
Type | Name | Description |
---|---|---|
HttpClient | client | The instantiated Http Client HttpClient |
String | requestUri | The Uri the request is sent to. |
HttpContent | content | The HTTP request content sent to the server. |
Returns
Type | Description |
---|---|
Task<HttpResponseMessage> | Returns Task<TResult>.The task object representing the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
ArgumentNullException | The |
PatchAsync(HttpClient, String, HttpContent, CancellationToken)
Send a PATCH request with a cancellation token as an asynchronous operation.
Declaration
public static Task<HttpResponseMessage> PatchAsync(this HttpClient client, string requestUri, HttpContent content, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
HttpClient | client | The instantiated Http Client HttpClient |
String | requestUri | The Uri the request is sent to. |
HttpContent | content | The HTTP request content sent to the server. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<HttpResponseMessage> | Returns Task<TResult>.The task object representing the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
ArgumentNullException | The |
PatchAsync(HttpClient, Uri, HttpContent)
Send a PATCH request to the specified Uri as an asynchronous operation.
Declaration
public static Task<HttpResponseMessage> PatchAsync(this HttpClient client, Uri requestUri, HttpContent content)
Parameters
Type | Name | Description |
---|---|---|
HttpClient | client | The instantiated Http Client HttpClient |
Uri | requestUri | The Uri the request is sent to. |
HttpContent | content | The HTTP request content sent to the server. |
Returns
Type | Description |
---|---|
Task<HttpResponseMessage> | Returns Task<TResult>.The task object representing the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
ArgumentNullException | The |
PatchAsync(HttpClient, Uri, HttpContent, CancellationToken)
Send a PATCH request with a cancellation token as an asynchronous operation.
Declaration
public static Task<HttpResponseMessage> PatchAsync(this HttpClient client, Uri requestUri, HttpContent content, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
HttpClient | client | The instantiated Http Client HttpClient |
Uri | requestUri | The Uri the request is sent to. |
HttpContent | content | The HTTP request content sent to the server. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<HttpResponseMessage> | Returns Task<TResult>.The task object representing the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
ArgumentNullException | The |