Dela via


JsonOutputFormatter Class

Definition

A TextOutputFormatter for JSON content.

public ref class JsonOutputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextOutputFormatter
public class JsonOutputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextOutputFormatter
type JsonOutputFormatter = class
    inherit TextOutputFormatter
Public Class JsonOutputFormatter
Inherits TextOutputFormatter
Inheritance

Constructors

JsonOutputFormatter(JsonSerializerSettings, ArrayPool<Char>)

Initializes a new JsonOutputFormatter instance.

Properties

PublicSerializerSettings

Gets the Newtonsoft.Json.JsonSerializerSettings used to configure the Newtonsoft.Json.JsonSerializer.

SerializerSettings

Gets the Newtonsoft.Json.JsonSerializerSettings used to configure the Newtonsoft.Json.JsonSerializer.

SupportedEncodings

Gets the mutable collection of character encodings supported by this TextOutputFormatter. The encodings are used when writing the data.

(Inherited from TextOutputFormatter)
SupportedMediaTypes

Gets the mutable collection of media type elements supported by this OutputFormatter.

(Inherited from OutputFormatter)

Methods

CanWriteResult(OutputFormatterCanWriteContext)

Determines whether this IOutputFormatter can serialize an object of the specified type.

(Inherited from OutputFormatter)
CanWriteType(Type)

Returns a value indicating whether or not the given type can be written by this serializer.

(Inherited from OutputFormatter)
CreateJsonSerializer()

Called during serialization to create the Newtonsoft.Json.JsonSerializer.

CreateJsonWriter(TextWriter)

Called during serialization to create the Newtonsoft.Json.JsonWriter.

GetSupportedContentTypes(String, Type)

Gets a filtered list of content types which are supported by the IOutputFormatter for the objectType and contentType.

(Inherited from OutputFormatter)
SelectCharacterEncoding(OutputFormatterWriteContext)

Determines the best Encoding amongst the supported encodings for reading or writing an HTTP entity body based on the provided content type.

(Inherited from TextOutputFormatter)
WriteAsync(OutputFormatterWriteContext)

Writes the object represented by context's Object property.

(Inherited from TextOutputFormatter)
WriteObject(TextWriter, Object)

Writes the given value as JSON using the given writer.

WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)

Writes the response body.

WriteResponseBodyAsync(OutputFormatterWriteContext)

Writes the response body.

(Inherited from TextOutputFormatter)
WriteResponseHeaders(OutputFormatterWriteContext)

Sets the headers on HttpResponse object.

(Inherited from OutputFormatter)

Applies to