JsonInputFormatter 类

定义

TextInputFormatter JSON 内容的 。

public ref class JsonInputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextInputFormatter
public ref class JsonInputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextInputFormatter, Microsoft::AspNetCore::Mvc::Formatters::IInputFormatterExceptionPolicy
public class JsonInputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextInputFormatter
public class JsonInputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextInputFormatter, Microsoft.AspNetCore.Mvc.Formatters.IInputFormatterExceptionPolicy
type JsonInputFormatter = class
    inherit TextInputFormatter
type JsonInputFormatter = class
    inherit TextInputFormatter
    interface IInputFormatterExceptionPolicy
Public Class JsonInputFormatter
Inherits TextInputFormatter
Public Class JsonInputFormatter
Inherits TextInputFormatter
Implements IInputFormatterExceptionPolicy
继承
派生
实现

构造函数

JsonInputFormatter(ILogger, JsonSerializerSettings, ArrayPool<Char>, ObjectPoolProvider)
已过时.

初始化 JsonInputFormatter 的新实例。

JsonInputFormatter(ILogger, JsonSerializerSettings, ArrayPool<Char>, ObjectPoolProvider, Boolean)
已过时.

初始化 JsonInputFormatter 的新实例。

JsonInputFormatter(ILogger, JsonSerializerSettings, ArrayPool<Char>, ObjectPoolProvider, Boolean, Boolean)
已过时.

初始化 JsonInputFormatter 的新实例。

JsonInputFormatter(ILogger, JsonSerializerSettings, ArrayPool<Char>, ObjectPoolProvider, MvcOptions, MvcJsonOptions)

初始化 JsonInputFormatter 的新实例。

属性

ExceptionPolicy

获取标志,以指示正文模型联编程序是否应处理所有异常。 如果处理了异常,主体模型联编程序会将异常转换为模型状态错误,否则允许该异常传播。

SerializerSettings

获取 Newtonsoft.Json.JsonSerializerSettings 用于配置 的 Newtonsoft.Json.JsonSerializer

SupportedEncodings

获取此 TextInputFormatter支持的字符编码的可变集合。 读取数据时使用编码。

(继承自 TextInputFormatter)
SupportedMediaTypes

获取此 InputFormatter支持的媒体类型元素的可变集合。

(继承自 InputFormatter)

方法

CanRead(InputFormatterContext)

确定这IInputFormatter是否可以反序列化 的 ModelType对象context

(继承自 InputFormatter)
CanReadType(Type)

确定这 InputFormatter 是否可以反序列化给定 type的 对象。

(继承自 InputFormatter)
CreateJsonSerializer()

在反序列化期间调用以获取 Newtonsoft.Json.JsonSerializer

GetDefaultValueForType(Type)

获取给定类型的默认值。 用于在正文不包含任何内容时返回默认值。

(继承自 InputFormatter)
GetSupportedContentTypes(String, Type)

获取 和 contentType支持的内容类型IInputFormatterobjectType的筛选列表。

(继承自 InputFormatter)
ReadAsync(InputFormatterContext)

从请求正文中读取 对象。

(继承自 InputFormatter)
ReadRequestBodyAsync(InputFormatterContext)

从请求正文中读取 对象。

(继承自 TextInputFormatter)
ReadRequestBodyAsync(InputFormatterContext, Encoding)

从请求正文中读取 对象。

ReleaseJsonSerializer(JsonSerializer)

释放 serializer 实例。

SelectCharacterEncoding(InputFormatterContext)

基于 context的字符集返回 Encoding

(继承自 TextInputFormatter)

适用于