Click or drag to resize

HttpClientExtensionsPatchSafeAsync Method (HttpClient, Uri, HttpContent, ArgDictionary, HttpCompletionOption, CancellationToken, LogActivity)

Sends a PATCH request to a Uri ensuring that the operation succeeded.

Namespace:  System.Net.Http
Assembly:  Neon.Common (in Neon.Common.dll) Version: 2.14.0
public static Task<HttpResponseMessage> PatchSafeAsync(
	this HttpClient client,
	Uri requestUri,
	HttpContent content,
	ArgDictionary headers = null,
	HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead,
	CancellationToken cancellationToken = null,
	LogActivity activity = null


Type: System.Net.HttpHttpClient
The client.
Type: SystemUri
The request URI.
Type: System.Net.HttpHttpContent
The content to be sent to the server.
headers (Optional)
Type: Neon.CollectionsArgDictionary
Optional request headers.
completionOption (Optional)
Type: System.Net.HttpHttpCompletionOption
Optionally specifies when the operation should complete (as soon as a response is available or after reading the whole response content).
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.
activity (Optional)
Type: Neon.DiagnosticsLogActivity
Optional LogActivity whose ID is to be included in the request.

Return Value

Type: TaskHttpResponseMessage
The response.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpClient. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
ArgumentNullExceptionThrown when a required argument is null.
SocketExceptionThrown for network connectivity issues.
HttpExceptionThrown when the server responds with an HTTP error status code.
See Also