SystemTextJsonOutputFormatter 類別

定義

TextOutputFormatter,用於使用 JsonSerializer 的 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)

取得 和 支援的內容類型 IOutputFormatterobjectTypecontentType 篩選清單。

(繼承來源 OutputFormatter)
SelectCharacterEncoding(OutputFormatterWriteContext)

Encoding根據提供的內容類型,決定讀取或寫入 HTTP 實體主體所支援編碼的最佳方式。

(繼承來源 TextOutputFormatter)
WriteAsync(OutputFormatterWriteContext)

寫入 物件,此物件是由 的 Object 屬性工作表示 context

(繼承來源 TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext)

寫入回應本文。

(繼承來源 TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)

寫入回應本文。

WriteResponseHeaders(OutputFormatterWriteContext)

設定 物件上的 HttpResponse 標頭。

(繼承來源 OutputFormatter)

適用於