Method
HttpRequest.GetJsonContentAsync<T>
GetJsonContentAsync<T>(JsonTypeInfo<T>, CancellationToken) #
Asynchronously deserializes the request body into an object of type T using the provided JsonTypeInfo.
public ValueTask<T?> GetJsonContentAsync<T>(JsonTypeInfo<T> typeInfo, CancellationToken cancellation = default)Parameters #
typeInfo JsonTypeInfo<T>
The JsonTypeInfo to use for deserialization.
cancellation CancellationToken
A CancellationToken to cancel the asynchronous operation.
Returns #
ValueTask<T?>
A ValueTask that represents the asynchronous deserialization operation.
Type Parameters #
T
The type of the object to deserialize into.
GetJsonContentAsync<T>(JsonSerializerOptions?, CancellationToken) #
Asynchronously deserializes the request body into an object of type T using the provided JsonSerializerOptions.
[RequiresDynamicCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
[RequiresUnreferencedCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
public ValueTask<T?> GetJsonContentAsync<T>(JsonSerializerOptions? jsonOptions, CancellationToken cancellation = default)Parameters #
jsonOptions JsonSerializerOptions?
The JsonSerializerOptions to use for deserialization.
cancellation CancellationToken
A CancellationToken to cancel the asynchronous operation.
Returns #
ValueTask<T?>
A ValueTask that represents the asynchronous deserialization operation.
Type Parameters #
T
The type of the object to deserialize into.
GetJsonContentAsync<T>(CancellationToken) #
Asynchronously deserializes the request body into an object of type T using the default JsonSerializerOptions.
[RequiresDynamicCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
[RequiresUnreferencedCode("JSON deserialization without a type info may require types that cannot be statically analyzed.")]
public ValueTask<T?> GetJsonContentAsync<T>(CancellationToken cancellation = default)Parameters #
cancellation CancellationToken
A CancellationToken to cancel the asynchronous operation.
Returns #
ValueTask<T?>
A ValueTask that represents the asynchronous deserialization operation.
Type Parameters #
T
The type of the object to deserialize into.