Send a DELETE request to the specified URI as an asynchronous operation.
Overloads DeleteAsync(String)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);
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)
Parameters
The URI the request is sent to.
ReturnsThe task object representing the asynchronous operation.
ExceptionsThe request message was already sent by the HttpClient instance.
-or-
The requestUri
is not an absolute URI.
-or-
BaseAddress is not set.
The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by HttpRequestError.
-or-
.NET Framework only: The request timed out.
.NET Core and .NET 5 and later only: The request failed due to timeout.
RemarksThis operation doesn't block. The returned Task<TResult> object will complete after the whole response (including content) is read.
DeleteAsync(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);
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)
Parameters
The URI the request is sent to.
ReturnsThe task object representing the asynchronous operation.
ExceptionsThe request message was already sent by the HttpClient instance.
-or-
The requestUri
is not an absolute URI.
-or-
BaseAddress is not set.
The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by HttpRequestError
-or-
.NET Framework only: the request timed out.
.NET Core and .NET 5 and later only: The request failed due to timeout.
RemarksThis operation doesn't block. The returned Task<TResult> object will complete after the whole response (including content) is read.
DeleteAsync(String, CancellationToken)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);
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>
Public Function DeleteAsync (requestUri As String, cancellationToken As CancellationToken) As Task(Of HttpResponseMessage)
Parameters
The URI the request is sent to.
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
ReturnsThe task object representing the asynchronous operation.
ExceptionsThe request message was already sent by the HttpClient instance.
-or-
The requestUri
is not an absolute URI.
-or-
BaseAddress is not set.
The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by HttpRequestError
-or-
.NET Framework only: the request timed out.
The cancellation token was canceled. This exception is stored into the returned task.
-or-
.NET Core and .NET 5 and later only: The request failed due to timeout.
RemarksThis operation doesn't block. The returned Task<TResult> object will complete after the whole response (including content) is read.
DeleteAsync(Uri, CancellationToken)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);
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>
Public Function DeleteAsync (requestUri As Uri, cancellationToken As CancellationToken) As Task(Of HttpResponseMessage)
Parameters
The URI the request is sent to.
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
ReturnsThe task object representing the asynchronous operation.
ExceptionsThe request message was already sent by the HttpClient instance.
-or-
The requestUri
is not an absolute URI.
-or-
BaseAddress is not set.
The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by HttpRequestError
-or-
.NET Framework only: the request timed out.
The cancellation token was canceled. This exception is stored into the returned task.
-or-
.NET Core and .NET 5 and later only: The request failed due to timeout.
RemarksThis operation doesn't block. The returned Task<TResult> object will complete after the whole response (including content) is read.
Note
In case of timeout, different exceptions are thrown on different .NET implementations.
- HttpRequestException is thrown on all applicable .NET Framework versions.
- OperationCanceledException without any inner exception is thrown on all applicable .NET Core versions.
- OperationCanceledException that nests a TimeoutException is thrown on .NET 5 and later versions.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4