StringOutputFormatter 类

定义

用于 TextOutputFormatter 简单文本内容的 。

public ref class StringOutputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextOutputFormatter
public class StringOutputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextOutputFormatter
type StringOutputFormatter = class
    inherit TextOutputFormatter
Public Class StringOutputFormatter
Inherits TextOutputFormatter
继承

构造函数

StringOutputFormatter()

创建仅支持编码为 UTF8Unicode的纯文本的新StringOutputFormatter

属性

SupportedEncodings

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

(继承自 TextOutputFormatter)
SupportedMediaTypes

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

(继承自 OutputFormatter)

方法

CanWriteResult(OutputFormatterCanWriteContext)

验证要格式化的对象是否为 , string 并继续执行 的标准检查 Microsoft.AspNetCore.Mvc.Formatters.OutputFormatter.CanWriteResult(OutputFormatterCanWriteContext)

CanWriteType(Type)

返回一个值,该值指示此序列化程序是否可以写入给定类型。

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

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

(继承自 OutputFormatter)
SelectCharacterEncoding(OutputFormatterWriteContext)

根据提供的内容类型,确定用于读取或写入 HTTP 实体正文的受支持编码中的最佳 Encoding 类型。

(继承自 TextOutputFormatter)
WriteAsync(OutputFormatterWriteContext)

写入 由 context的 Object 属性表示的对象。

(继承自 TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext)

写入响应正文。

(继承自 TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)

写入响应正文。

WriteResponseHeaders(OutputFormatterWriteContext)

设置 对象上的 HttpResponse 标头。

(继承自 OutputFormatter)

适用于