TextInputFormatter 类

定义

使用文本格式从请求正文中读取对象。

public ref class TextInputFormatter abstract : Microsoft::AspNetCore::Mvc::Formatters::InputFormatter
public abstract class TextInputFormatter : Microsoft.AspNetCore.Mvc.Formatters.InputFormatter
type TextInputFormatter = class
    inherit InputFormatter
Public MustInherit Class TextInputFormatter
Inherits InputFormatter
继承
TextInputFormatter
派生

构造函数

TextInputFormatter()

使用文本格式从请求正文中读取对象。

字段

UTF16EncodingLittleEndian

返回 UTF16 编码,该编码使用 littleEndian 字节顺序和 BOM,并在无效字节上引发。

UTF8EncodingWithoutBOM

返回不带 BOM 的 UTF8 编码,并在无效字节上引发 。

属性

SupportedEncodings

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

SupportedMediaTypes

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

(继承自 InputFormatter)

方法

CanRead(InputFormatterContext)

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

(继承自 InputFormatter)
CanReadType(Type)

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

(继承自 InputFormatter)
GetDefaultValueForType(Type)

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

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

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

(继承自 InputFormatter)
ReadAsync(InputFormatterContext)

从请求正文中读取 对象。

(继承自 InputFormatter)
ReadRequestBodyAsync(InputFormatterContext)

从请求正文中读取 对象。

ReadRequestBodyAsync(InputFormatterContext, Encoding)

从请求正文中读取 对象。

SelectCharacterEncoding(InputFormatterContext)

基于 context的字符集返回 Encoding

适用于