HttpRequestJsonExtensions 类

定义

扩展方法,用于将请求正文读取为 JSON。

public ref class HttpRequestJsonExtensions abstract sealed
public static class HttpRequestJsonExtensions
type HttpRequestJsonExtensions = class
Public Module HttpRequestJsonExtensions
继承
HttpRequestJsonExtensions

方法

HasJsonContentType(HttpRequest)

检查 Content-Type 标头中的 JSON 类型。

ReadFromJsonAsync(HttpRequest, JsonTypeInfo, CancellationToken)

从请求中读取 JSON 并反序列化为对象类型。 如果请求的内容类型不是已知的 JSON 类型,则会引发错误。

ReadFromJsonAsync(HttpRequest, Type, CancellationToken)

从请求中读取 JSON 并反序列化为指定的类型。 如果请求的内容类型不是已知的 JSON 类型,则会引发错误。

ReadFromJsonAsync(HttpRequest, Type, JsonSerializerContext, CancellationToken)

从请求中读取 JSON 并反序列化为指定的类型。 如果请求的内容类型不是已知的 JSON 类型,则会引发错误。

ReadFromJsonAsync(HttpRequest, Type, JsonSerializerOptions, CancellationToken)

从请求中读取 JSON 并反序列化为指定的类型。 如果请求的内容类型不是已知的 JSON 类型,则会引发错误。

ReadFromJsonAsync<TValue>(HttpRequest, CancellationToken)

从请求中读取 JSON 并反序列化为指定的类型。 如果请求的内容类型不是已知的 JSON 类型,则会引发错误。

ReadFromJsonAsync<TValue>(HttpRequest, JsonSerializerOptions, CancellationToken)

从请求中读取 JSON 并反序列化为指定的类型。 如果请求的内容类型不是已知的 JSON 类型,则会引发错误。

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

从请求中读取 JSON 并反序列化为指定的类型。 如果请求的内容类型不是已知的 JSON 类型,则会引发错误。

适用于