Прочетете на английски

Споделяне чрез


HttpRequestJsonExtensions Class

Definition

Extension methods to read the request body as JSON.

C#
public static class HttpRequestJsonExtensions
Inheritance
HttpRequestJsonExtensions

Methods

HasJsonContentType(HttpRequest)

Checks the Content-Type header for JSON types.

ReadFromJsonAsync(HttpRequest, JsonTypeInfo, CancellationToken)

Read JSON from the request and deserialize to object type. If the request's content-type is not a known JSON type then an error will be thrown.

ReadFromJsonAsync(HttpRequest, Type, CancellationToken)

Read JSON from the request and deserialize to the specified type. If the request's content-type is not a known JSON type then an error will be thrown.

ReadFromJsonAsync(HttpRequest, Type, JsonSerializerContext, CancellationToken)

Read JSON from the request and deserialize to the specified type. If the request's content-type is not a known JSON type then an error will be thrown.

ReadFromJsonAsync(HttpRequest, Type, JsonSerializerOptions, CancellationToken)

Read JSON from the request and deserialize to the specified type. If the request's content-type is not a known JSON type then an error will be thrown.

ReadFromJsonAsync<TValue>(HttpRequest, CancellationToken)

Read JSON from the request and deserialize to the specified type. If the request's content-type is not a known JSON type then an error will be thrown.

ReadFromJsonAsync<TValue>(HttpRequest, JsonSerializerOptions, CancellationToken)

Read JSON from the request and deserialize to the specified type. If the request's content-type is not a known JSON type then an error will be thrown.

ReadFromJsonAsync<TValue>(HttpRequest, JsonTypeInfo<TValue>, CancellationToken)

Read JSON from the request and deserialize to the specified type. If the request's content-type is not a known JSON type then an error will be thrown.

Applies to

Продукт Версии
ASP.NET Core 5.0, 6.0, 7.0, 8.0, 9.0