SystemTextJsonInputFormatter 類別

定義

TextInputFormatter 用於使用 JsonSerializer 的 JSON 內容。

public ref class SystemTextJsonInputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextInputFormatter, Microsoft::AspNetCore::Mvc::Formatters::IInputFormatterExceptionPolicy
public class SystemTextJsonInputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextInputFormatter, Microsoft.AspNetCore.Mvc.Formatters.IInputFormatterExceptionPolicy
type SystemTextJsonInputFormatter = class
    inherit TextInputFormatter
    interface IInputFormatterExceptionPolicy
Public Class SystemTextJsonInputFormatter
Inherits TextInputFormatter
Implements IInputFormatterExceptionPolicy
繼承
SystemTextJsonInputFormatter
實作

建構函式

SystemTextJsonInputFormatter(JsonOptions, ILogger<SystemTextJsonInputFormatter>)

初始化 SystemTextJsonInputFormatter 的新執行個體。

屬性

SerializerOptions

JsonSerializerOptions取得用來設定 的 JsonSerializer

SupportedEncodings

取得這個 TextInputFormatter 所支援之字元編碼的可變動集合。 讀取資料時會使用編碼方式。

(繼承來源 TextInputFormatter)
SupportedMediaTypes

取得這個 InputFormatter 所支援之媒體類型專案的可變動集合。

(繼承來源 InputFormatter)

方法

CanRead(InputFormatterContext)

判斷這 IInputFormatter 是否可以還原序列化 的 ModelType 物件 context

(繼承來源 InputFormatter)
CanReadType(Type)

判斷這 InputFormatter 是否可以還原序列化指定 type 的物件。

(繼承來源 InputFormatter)
GetDefaultValueForType(Type)

取得指定型別的預設值。 當本文不包含任何內容時,用來傳回預設值。

(繼承來源 InputFormatter)
GetSupportedContentTypes(String, Type)

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

(繼承來源 InputFormatter)
ReadAsync(InputFormatterContext)

從要求本文讀取 物件。

(繼承來源 InputFormatter)
ReadRequestBodyAsync(InputFormatterContext)

從要求本文讀取 物件。

(繼承來源 TextInputFormatter)
ReadRequestBodyAsync(InputFormatterContext, Encoding)

從要求本文讀取 物件。

SelectCharacterEncoding(InputFormatterContext)

Encoding根據 context 的字元集傳回 。

(繼承來源 TextInputFormatter)

明確介面實作

IInputFormatterExceptionPolicy.ExceptionPolicy

取得旗標,指出主體模型系結器是否應該處理所有例外狀況。 如果處理例外狀況,主體模型系結器會將例外狀況轉換成模型狀態錯誤,否則允許傳播例外狀況。

適用於