HttpClient.DeleteAsync HttpClient.DeleteAsync HttpClient.DeleteAsync HttpClient.DeleteAsync Method

Definition

以异步操作将 DELETE 请求发送给指定 URI。 Send a DELETE request to the specified Uri as an asynchronous operation.

Overloads

DeleteAsync(String) DeleteAsync(String) DeleteAsync(String) DeleteAsync(String)

以异步操作将 DELETE 请求发送给指定 URI。 Send a DELETE request to the specified Uri as an asynchronous operation.

DeleteAsync(Uri) DeleteAsync(Uri) DeleteAsync(Uri) DeleteAsync(Uri)

以异步操作将 DELETE 请求发送给指定 URI。 Send a DELETE request to the specified Uri as an asynchronous operation.

DeleteAsync(String, CancellationToken) DeleteAsync(String, CancellationToken) DeleteAsync(String, CancellationToken)

用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation.

DeleteAsync(Uri, CancellationToken) DeleteAsync(Uri, CancellationToken) DeleteAsync(Uri, CancellationToken)

用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation.

DeleteAsync(String) DeleteAsync(String) DeleteAsync(String) DeleteAsync(String)

以异步操作将 DELETE 请求发送给指定 URI。 Send a DELETE request to the specified Uri as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ DeleteAsync(System::String ^ requestUri);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync (string requestUri);
member this.DeleteAsync : string -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function DeleteAsync (requestUri As String) As Task(Of HttpResponseMessage)

参数

requestUri
String String String String

请求发送到的 URI。 The Uri the request is sent to.

Returns

表示异步操作的任务对象。 The task object representing the asynchronous operation.

Exceptions

请求消息已由 HttpClient 实例发送。 The request message was already sent by the HttpClient instance.

由于基础问题(如网络连接性、DNS 失败、服务器证书验证或超时),请求失败。 The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.

Remarks

不会阻止此操作。This operation will not block. 返回Task<TResult>读取 (包括内容) 的整个响应后,将完成对象。The returned Task<TResult> object will complete after the whole response (including content) is read.

DeleteAsync(Uri) DeleteAsync(Uri) DeleteAsync(Uri) DeleteAsync(Uri)

以异步操作将 DELETE 请求发送给指定 URI。 Send a DELETE request to the specified Uri as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ DeleteAsync(Uri ^ requestUri);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync (Uri requestUri);
member this.DeleteAsync : Uri -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function DeleteAsync (requestUri As Uri) As Task(Of HttpResponseMessage)

参数

requestUri
Uri Uri Uri Uri

请求发送到的 URI。 The Uri the request is sent to.

Returns

表示异步操作的任务对象。 The task object representing the asynchronous operation.

Exceptions

请求消息已由 HttpClient 实例发送。 The request message was already sent by the HttpClient instance.

由于基础问题(如网络连接性、DNS 失败、服务器证书验证或超时),请求失败。 The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.

Remarks

不会阻止此操作。This operation will not block. 返回Task<TResult>读取 (包括内容) 的整个响应后,将完成对象。The returned Task<TResult> object will complete after the whole response (including content) is read.

DeleteAsync(String, CancellationToken) DeleteAsync(String, CancellationToken) DeleteAsync(String, CancellationToken)

用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ DeleteAsync(System::String ^ requestUri, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync (string requestUri, System.Threading.CancellationToken cancellationToken);
member this.DeleteAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

参数

requestUri
String String String String

请求发送到的 URI。 The Uri the request is sent to.

cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

可由其他对象或线程用以接收取消通知的取消标记。 A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

表示异步操作的任务对象。 The task object representing the asynchronous operation.

Exceptions

请求消息已由 HttpClient 实例发送。 The request message was already sent by the HttpClient instance.

由于基础问题(如网络连接性、DNS 失败、服务器证书验证或超时),请求失败。 The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.

Remarks

不会阻止此操作。This operation will not block. 返回Task<TResult>读取 (包括内容) 的整个响应后,将完成对象。The returned Task<TResult> object will complete after the whole response (including content) is read.

DeleteAsync(Uri, CancellationToken) DeleteAsync(Uri, CancellationToken) DeleteAsync(Uri, CancellationToken)

用以异步操作的取消标记发送 DELETE 请求到指定的 URI。 Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ DeleteAsync(Uri ^ requestUri, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> DeleteAsync (Uri requestUri, System.Threading.CancellationToken cancellationToken);
member this.DeleteAsync : Uri * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

参数

requestUri
Uri Uri Uri Uri

请求发送到的 URI。 The Uri the request is sent to.

cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

可由其他对象或线程用以接收取消通知的取消标记。 A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

表示异步操作的任务对象。 The task object representing the asynchronous operation.

Exceptions

请求消息已由 HttpClient 实例发送。 The request message was already sent by the HttpClient instance.

由于基础问题(如网络连接性、DNS 失败、服务器证书验证或超时),请求失败。 The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.

Remarks

不会阻止此操作。This operation will not block. 返回Task<TResult>读取 (包括内容) 的整个响应后,将完成对象。The returned Task<TResult> object will complete after the whole response (including content) is read.

Applies to