DefaultContentNegotiator.MatchRequestMediaType Method (HttpRequestMessage, MediaTypeFormatter)

 

Match the content type of a request against the media types that a formatter supports.

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

protected virtual MediaTypeFormatterMatch MatchRequestMediaType(
	HttpRequestMessage request,
	MediaTypeFormatter formatter
)

Parameters

request
Type: System.Net.Http.HttpRequestMessage

The request to match.

formatter
Type: System.Net.Http.Formatting.MediaTypeFormatter

The formatter to match against.

Return Value

Type: System.Net.Http.Formatting.MediaTypeFormatterMatch

Returns a MediaTypeFormatterMatch object that indicates the quality of the match, or null if there is no match.

Return to top
Show: