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.GetPerRequestFormatterInstance Method

Returns a specialized instance of the MediaTypeFormatter that can format a response for the given parameters.

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

public virtual MediaTypeFormatter GetPerRequestFormatterInstance(
	Type type,
	HttpRequestMessage request,
	MediaTypeHeaderValue mediaType
)

Parameters

type
Type: System.Type
The type to format.
request
Type: HttpRequestMessage
The request.
mediaType
Type: MediaTypeHeaderValue
The media type.

The DefaultContentNegotiator calls this method after it selects a formatter. The default implementation returns this instance. A derived class can return a new instance if it needs to initialize the formatter or use a specialized version.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft