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.

MediaTypeFormatter.SetDefaultContentHeaders Method (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.

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

Public Overridable Sub SetDefaultContentHeaders (
	type As Type,
	headers As HttpContentHeaders,
	mediaType As MediaTypeHeaderValue
)

Parameters

type
Type: System.Type

The type of the object being serialized. See ObjectContent.

headers
Type: System.Net.Http.Headers.HttpContentHeaders

The content headers that should be configured.

mediaType
Type: System.Net.Http.Headers.MediaTypeHeaderValue

The authoritative media type. Can be null.

Return to top
Show: