HttpClient.PatchAsync 方法

定義

多載

PatchAsync(String, HttpContent)

以非同步作業的方式,將 PATCH 要求傳送至指定為字串的 URI。Sends a PATCH request to a Uri designated as a string as an asynchronous operation.

PatchAsync(Uri, HttpContent)

以非同步作業的方式傳送 PATCH 要求。Sends a PATCH request as an asynchronous operation.

PatchAsync(String, HttpContent, CancellationToken)

以非同步作業的方式,將 PATCH 要求和取消權杖傳送至以字串表示的 URI。Sends a PATCH request with a cancellation token to a Uri represented as a string as an asynchronous operation.

PatchAsync(Uri, HttpContent, CancellationToken)

以非同步作業的方式,傳送 PATCH 要求和取消語彙基元。Sends a PATCH request with a cancellation token as an asynchronous operation.

PatchAsync(String, HttpContent)

以非同步作業的方式,將 PATCH 要求傳送至指定為字串的 URI。Sends a PATCH request to a Uri designated as a string as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PatchAsync(System::String ^ requestUri, System::Net::Http::HttpContent ^ content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync (string? requestUri, System.Net.Http.HttpContent content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync (string requestUri, System.Net.Http.HttpContent content);
member this.PatchAsync : string * System.Net.Http.HttpContent -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function PatchAsync (requestUri As String, content As HttpContent) As Task(Of HttpResponseMessage)

參數

requestUri
String

傳送要求的目標 URI。The Uri the request is sent to.

content
HttpContent

傳送至伺服器的 HTTP 要求內容。The HTTP request content sent to the server.

傳回

Task<HttpResponseMessage>

工作物件,表示非同步作業。The task object representing the asynchronous operation.

備註

這項作業不會封鎖。This operation will not block. 傳回的 Task<TResult> 物件會在讀取完整的回應 (包括內容) 之後完成。The returned Task<TResult> object will complete after the whole response (including content) is read.

適用於

PatchAsync(Uri, HttpContent)

以非同步作業的方式傳送 PATCH 要求。Sends a PATCH request as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PatchAsync(Uri ^ requestUri, System::Net::Http::HttpContent ^ content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync (Uri? requestUri, System.Net.Http.HttpContent content);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync (Uri requestUri, System.Net.Http.HttpContent content);
member this.PatchAsync : Uri * System.Net.Http.HttpContent -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function PatchAsync (requestUri As Uri, content As HttpContent) As Task(Of HttpResponseMessage)

參數

requestUri
Uri

傳送要求的目標 URI。The Uri the request is sent to.

content
HttpContent

傳送至伺服器的 HTTP 要求內容。The HTTP request content sent to the server.

傳回

Task<HttpResponseMessage>

工作物件,表示非同步作業。The task object representing the asynchronous operation.

備註

這項作業不會封鎖。This operation will not block. 傳回的 Task<TResult> 物件會在讀取完整的回應 (包括內容) 之後完成。The returned Task<TResult> object will complete after the whole response (including content) is read.

適用於

PatchAsync(String, HttpContent, CancellationToken)

以非同步作業的方式,將 PATCH 要求和取消權杖傳送至以字串表示的 URI。Sends a PATCH request with a cancellation token to a Uri represented as a string as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PatchAsync(System::String ^ requestUri, System::Net::Http::HttpContent ^ content, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync (string? requestUri, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync (string requestUri, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken);
member this.PatchAsync : string * System.Net.Http.HttpContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function PatchAsync (requestUri As String, content As HttpContent, cancellationToken As CancellationToken) As Task(Of HttpResponseMessage)

參數

requestUri
String

傳送要求的目標 URI。The Uri the request is sent to.

content
HttpContent

傳送至伺服器的 HTTP 要求內容。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.

傳回

Task<HttpResponseMessage>

工作物件,表示非同步作業。The task object representing the asynchronous operation.

備註

這項作業不會封鎖。This operation will not block. 傳回的 Task<TResult> 物件會在讀取完整的回應 (包括內容) 之後完成。The returned Task<TResult> object will complete after the whole response (including content) is read.

適用於

PatchAsync(Uri, HttpContent, CancellationToken)

以非同步作業的方式,傳送 PATCH 要求和取消語彙基元。Sends a PATCH request with a cancellation token as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ PatchAsync(Uri ^ requestUri, System::Net::Http::HttpContent ^ content, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync (Uri? requestUri, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> PatchAsync (Uri requestUri, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken);
member this.PatchAsync : Uri * System.Net.Http.HttpContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function PatchAsync (requestUri As Uri, content As HttpContent, cancellationToken As CancellationToken) As Task(Of HttpResponseMessage)

參數

requestUri
Uri

傳送要求的目標 URI。The Uri the request is sent to.

content
HttpContent

傳送至伺服器的 HTTP 要求內容。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.

傳回

Task<HttpResponseMessage>

工作物件,表示非同步作業。The task object representing the asynchronous operation.

備註

這項作業不會封鎖。This operation will not block. 傳回的 Task<TResult> 物件會在讀取完整的回應 (包括內容) 之後完成。The returned Task<TResult> object will complete after the whole response (including content) is read.

適用於