SystemTextJsonOutputFormatter 类

定义

使用 TextOutputFormatterJsonSerializer的 JSON 内容的 。

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

构造函数

SystemTextJsonOutputFormatter(JsonSerializerOptions)

初始化一个新 SystemTextJsonOutputFormatter 实例。

属性

SerializerOptions

获取 JsonSerializerOptions 用于配置 的 JsonSerializer

SupportedEncodings

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

(继承自 TextOutputFormatter)
SupportedMediaTypes

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

(继承自 OutputFormatter)

方法

CanWriteResult(OutputFormatterCanWriteContext)

确定这 IOutputFormatter 是否可以序列化指定类型的对象。

(继承自 OutputFormatter)
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)

适用于