Microsoft.AspNetCore.Mvc.Formatters Namespace

Provides types that allow returning JSON, and XML based input and output formatters.

Classes

FormatFilter

A filter that will use the format value in the route data or query string to set the content type on an ObjectResult returned from an action.

FormatterCollection<TFormatter>

Represents a collection of formatters.

FormatterMappings

Used to specify mapping between the URL Format and corresponding media type.

HttpNoContentOutputFormatter

Sets the status code to 204 if the content is null.

InputFormatter

Reads an object from the request body.

InputFormatterContext

A context object used by an input formatter for deserializing the request body into an object.

InputFormatterException

Exception thrown by IInputFormatter when the input is not in an expected format.

InputFormatterResult

Result of a ReadAsync(InputFormatterContext) operation.

JsonInputFormatter

A TextInputFormatter for JSON content.

JsonOutputFormatter

A TextOutputFormatter for JSON content.

JsonPatchInputFormatter

A TextInputFormatter for JSON Patch (application/json-patch+json) content.

JsonSerializerSettingsProvider

Helper class which provides Newtonsoft.Json.JsonSerializerSettings.

MediaTypeCollection

A collection of media types.

NewtonsoftJsonInputFormatter

A TextInputFormatter for JSON content.

NewtonsoftJsonOutputFormatter

A TextOutputFormatter for JSON content.

NewtonsoftJsonPatchInputFormatter

A TextInputFormatter for JSON Patch (application/json-patch+json) content.

OutputFormatter

Writes an object to the output stream.

OutputFormatterCanWriteContext

A context object for CanWriteResult(OutputFormatterCanWriteContext).

OutputFormatterWriteContext

A context object for WriteAsync(OutputFormatterWriteContext).

StreamOutputFormatter

Always copies the Stream to the response, regardless of requested content type.

StringOutputFormatter

A TextOutputFormatter for simple text content.

SystemTextJsonInputFormatter

A TextInputFormatter for JSON content that uses JsonSerializer.

SystemTextJsonOutputFormatter

A TextOutputFormatter for JSON content that uses JsonSerializer.

TextInputFormatter

Reads an object from a request body with a text format.

TextOutputFormatter

Writes an object in a given text format to the output stream.

XmlDataContractSerializerInputFormatter

This class handles deserialization of input XML data to strongly-typed objects using DataContractSerializer.

XmlDataContractSerializerOutputFormatter

This class handles serialization of objects to XML using DataContractSerializer

XmlSerializerInputFormatter

This class handles deserialization of input XML data to strongly-typed objects using XmlSerializer

XmlSerializerOutputFormatter

This class handles serialization of objects to XML using XmlSerializer

Structs

MediaType

A media type value.

MediaTypeSegmentWithQuality

A media type with its associated quality.

Interfaces

IInputFormatter

Reads an object from the request body.

IInputFormatterExceptionPolicy

A policy which IInputFormatters can implement to indicate if they want the body model binder to handle all exceptions. By default, all default IInputFormatters implement this interface and have a default value of MalformedInputExceptions.

IOutputFormatter

Writes an object to the output stream.

Enums

InputFormatterExceptionPolicy

Defines the set of policies that determine how the model binding system interprets exceptions thrown by an IInputFormatter.

Remarks

For more information abouting formatting response data, see Format response data.