HttpClientJsonExtensions.DeleteFromJsonAsync Method

Definition

Overloads

DeleteFromJsonAsync(HttpClient, String, Type, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync(HttpClient, Uri, Type, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync(HttpClient, String, Type, JsonSerializerOptions, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync(HttpClient, String, Type, JsonSerializerContext, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync(HttpClient, Uri, Type, JsonSerializerOptions, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync(HttpClient, Uri, Type, JsonSerializerContext, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync<TValue>(HttpClient, Uri, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync<TValue>(HttpClient, String, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken)

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

DeleteFromJsonAsync(HttpClient, String, Type, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<object?> DeleteFromJsonAsync (this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Threading.CancellationToken cancellationToken = default);

Parameters

client
HttpClient

The client used to send the request.

requestUri
String

The Uri the request is sent to.

type
Type

The type of the object to deserialize to and return.

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

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync(HttpClient, Uri, Type, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<object?> DeleteFromJsonAsync (this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Threading.CancellationToken cancellationToken = default);

Parameters

client
HttpClient

The client used to send the request.

requestUri
Uri

The Uri the request is sent to.

type
Type

The type of the object to deserialize to and return.

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

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync(HttpClient, String, Type, JsonSerializerOptions, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<object?> DeleteFromJsonAsync (this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);

Parameters

client
HttpClient

The client used to send the request.

requestUri
String

The Uri the request is sent to.

type
Type

The type of the object to deserialize to and return.

options
JsonSerializerOptions

Options to control the behavior during serialization. The default options are those specified by Web.

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

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync(HttpClient, String, Type, JsonSerializerContext, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<object?> DeleteFromJsonAsync (this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Text.Json.Serialization.JsonSerializerContext context, System.Threading.CancellationToken cancellationToken = default);

Parameters

client
HttpClient

The client used to send the request.

requestUri
String

The Uri the request is sent to.

type
Type

The type of the object to deserialize to and return.

context
JsonSerializerContext

The JsonSerializerContext used to control the deserialization behavior.

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

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync(HttpClient, Uri, Type, JsonSerializerOptions, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<object?> DeleteFromJsonAsync (this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);

Parameters

client
HttpClient

The client used to send the request.

requestUri
Uri

The Uri the request is sent to.

type
Type

The type of the object to deserialize to and return.

options
JsonSerializerOptions

Options to control the behavior during serialization. The default options are those specified by Web.

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

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync(HttpClient, Uri, Type, JsonSerializerContext, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<object?> DeleteFromJsonAsync (this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Text.Json.Serialization.JsonSerializerContext context, System.Threading.CancellationToken cancellationToken = default);

Parameters

client
HttpClient

The client used to send the request.

requestUri
Uri

The Uri the request is sent to.

type
Type

The type of the object to deserialize to and return.

context
JsonSerializerContext

The JsonSerializerContext used to control the deserialization behavior.

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

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<TValue?> DeleteFromJsonAsync<TValue> (this System.Net.Http.HttpClient client, Uri? requestUri, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
Uri

The Uri the request is sent to.

jsonTypeInfo
JsonTypeInfo<TValue>

The JsonTypeInfo used to control the deserialization behavior.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<TValue>

The task object representing the asynchronous operation.

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<TValue?> DeleteFromJsonAsync<TValue> (this System.Net.Http.HttpClient client, Uri? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
Uri

The Uri the request is sent to.

options
JsonSerializerOptions

Options to control the behavior during serialization. The default options are those specified by Web.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<TValue>

The task object representing the asynchronous operation.

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<TValue?> DeleteFromJsonAsync<TValue> (this System.Net.Http.HttpClient client, string? requestUri, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
String

The Uri the request is sent to.

jsonTypeInfo
JsonTypeInfo<TValue>

The JsonTypeInfo used to control the deserialization behavior.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<TValue>

The task object representing the asynchronous operation.

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync<TValue>(HttpClient, Uri, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<TValue?> DeleteFromJsonAsync<TValue> (this System.Net.Http.HttpClient client, Uri? requestUri, System.Threading.CancellationToken cancellationToken = default);

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
Uri

The Uri the request is sent to.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<TValue>

The task object representing the asynchronous operation.

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync<TValue>(HttpClient, String, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<TValue?> DeleteFromJsonAsync<TValue> (this System.Net.Http.HttpClient client, string? requestUri, System.Threading.CancellationToken cancellationToken = default);

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
String

The Uri the request is sent to.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<TValue>

The task object representing the asynchronous operation.

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

DeleteFromJsonAsync<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken)

Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs
Source:
HttpClientJsonExtensions.Delete.cs

Sends a DELETE request to the specified Uri and returns the value that results from deserializing the response body as JSON in an asynchronous operation.

public static System.Threading.Tasks.Task<TValue?> DeleteFromJsonAsync<TValue> (this System.Net.Http.HttpClient client, string? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
String

The Uri the request is sent to.

options
JsonSerializerOptions

Options to control the behavior during serialization. The default options are those specified by Web.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<TValue>

The task object representing the asynchronous operation.

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)