MediaTypeFormatter Class

MediaTypeFormatter Class

 

Base class to handle serializing and deserializing strongly-typed objects using ObjectContent.

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


No code example is currently available or this language may not be supported.

NameDescription
System_CAPS_protmethodMediaTypeFormatter()

Initializes a new instance of the MediaTypeFormatter class.

System_CAPS_protmethodMediaTypeFormatter(MediaTypeFormatter)

Initializes a new instance of the MediaTypeFormatter class.

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticMaxHttpCollectionKeys

Gets or sets the maximum number of keys stored in a T: System.Collections.Specialized.NameValueCollection.

System_CAPS_pubpropertyMediaTypeMappings

Gets the mutable collection of MediaTypeMapping objects that match HTTP requests to media types.

System_CAPS_pubpropertyRequiredMemberSelector

Gets or sets the IRequiredMemberSelector instance used to determine required members.

System_CAPS_pubpropertySupportedEncodings

Gets the mutable collection of character encodings supported bythis MediaTypeFormatter.

System_CAPS_pubpropertySupportedMediaTypes

Gets the mutable collection of media types supported bythis MediaTypeFormatter.

NameDescription
System_CAPS_pubmethodCanReadType(Type)

Queries whether this MediaTypeFormatter can deserializean object of the specified type.

System_CAPS_pubmethodCanWriteType(Type)

Queries whether this MediaTypeFormatter can serializean object of the specified type.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticGetDefaultValueForType(Type)

Gets the default value for the specified type.

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.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger)

Asynchronously deserializes an object of the specified type.

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

Asynchronously deserializes an object of the specified type.

System_CAPS_pubmethodSelectCharacterEncoding(HttpContentHeaders)

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

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.

System_CAPS_pubmethodToString()

(Inherited from Object.)

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

Asynchronously writes an object of the specified type.

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

Asynchronously writes an object of the specified type.

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:
© 2016 Microsoft