Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

JsonMediaTypeFormatter Class

 

Represents the MediaTypeFormatter class to handle JSON.

Namespace:   System.Net.Http.Formatting
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)


type JsonMediaTypeFormatter = 
    class
        inherit BaseJsonMediaTypeFormatter
    end

NameDescription
System_CAPS_pubmethodJsonMediaTypeFormatter()

Initializes a new instance of the JsonMediaTypeFormatter class.

System_CAPS_protmethodJsonMediaTypeFormatter(JsonMediaTypeFormatter)

Initializes a new instance of the JsonMediaTypeFormatter class.

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticDefaultMediaType

Gets the default media type for JSON, namely "application/json".

System_CAPS_pubpropertyIndent

Gets or sets a value indicating whether to indent elements when writing data.

System_CAPS_pubpropertyMaxDepth

Gets or sets the maximum depth allowed by this formatter.(Overrides BaseJsonMediaTypeFormatter.MaxDepth.)

System_CAPS_pubpropertyMediaTypeMappings

Gets the mutable collection of MediaTypeMapping objects that match HTTP requests to media types.(Inherited from MediaTypeFormatter.)

System_CAPS_pubpropertyRequiredMemberSelector

Gets or sets the IRequiredMemberSelector instance used to determine required members.(Inherited from MediaTypeFormatter.)

System_CAPS_pubpropertySerializerSettings

Gets or sets the JsonSerializerSettings used to configure the JsonSerializer.(Inherited from BaseJsonMediaTypeFormatter.)

System_CAPS_pubpropertySupportedEncodings

Gets the mutable collection of character encodings supported bythis MediaTypeFormatter.(Inherited from MediaTypeFormatter.)

System_CAPS_pubpropertySupportedMediaTypes

Gets the mutable collection of media types supported bythis MediaTypeFormatter.(Inherited from MediaTypeFormatter.)

System_CAPS_pubpropertyUseDataContractJsonSerializer

Gets or sets a value indicating whether to use DataContractJsonSerializer by default.

NameDescription
System_CAPS_pubmethodCanReadType(Type)

Determines whether this JsonMediaTypeFormatter can read objects of the specified type.(Overrides BaseJsonMediaTypeFormatter.CanReadType(Type).)

System_CAPS_pubmethodCanWriteType(Type)

Determines whether this JsonMediaTypeFormatter can write objects of the specified type.(Overrides BaseJsonMediaTypeFormatter.CanWriteType(Type).)

System_CAPS_pubmethodCreateDataContractSerializer(Type)

Called during deserialization to get the DataContractJsonSerializer.

System_CAPS_pubmethodCreateDefaultSerializerSettings()

Creates a JsonSerializerSettings instance with the default settings used by the BaseJsonMediaTypeFormatter.(Inherited from BaseJsonMediaTypeFormatter.)

System_CAPS_pubmethodCreateJsonReader(Type, Stream, Encoding)

Called during deserialization to get the JsonReader.(Overrides BaseJsonMediaTypeFormatter.CreateJsonReader(Type, Stream, Encoding).)

System_CAPS_pubmethodCreateJsonSerializer()

Called during serialization and deserialization to get the JsonSerializer.(Inherited from BaseJsonMediaTypeFormatter.)

System_CAPS_pubmethodCreateJsonWriter(Type, Stream, Encoding)

Called during serialization to get the JsonWriter.(Overrides BaseJsonMediaTypeFormatter.CreateJsonWriter(Type, Stream, Encoding).)

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetPerRequestFormatterInstance(Type, HttpRequestMessage, MediaTypeHeaderValue)

Returns a specialized instance of the MediaTypeFormatter that can format a response for the given parameters.(Inherited from MediaTypeFormatter.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodReadFromStream(Type, Stream, Encoding, IFormatterLogger)

Called during deserialization to read an object of the specified type from the specified stream.(Overrides BaseJsonMediaTypeFormatter.ReadFromStream(Type, Stream, Encoding, IFormatterLogger).)

System_CAPS_pubmethodReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger)

Called during deserialization to read an object of the specified type from the specified stream.(Inherited from BaseJsonMediaTypeFormatter.)

System_CAPS_pubmethodReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger, CancellationToken)

Asynchronously deserializes an object of the specified type.(Inherited from MediaTypeFormatter.)

System_CAPS_pubmethodSelectCharacterEncoding(HttpContentHeaders)

Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers.(Inherited from MediaTypeFormatter.)

System_CAPS_pubmethodSetDefaultContentHeaders(Type, HttpContentHeaders, MediaTypeHeaderValue)

Sets the default headers for content that will be formatted using this formatter. This method is called from the ObjectContent constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured Encoding. (Inherited from MediaTypeFormatter.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodWriteToStream(Type, Object, Stream, Encoding)

Called during serialization to write an object of the specified type to the specified stream.(Overrides BaseJsonMediaTypeFormatter.WriteToStream(Type, Object, Stream, Encoding).)

System_CAPS_pubmethodWriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext)

Asynchronously writes an object of the specified type.(Inherited from MediaTypeFormatter.)

System_CAPS_pubmethodWriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext, CancellationToken)

Called during serialization to write an object of the specified type to the specified stream.(Overrides BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext, CancellationToken).)

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: