<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="4.1.0-alpha-120809" />

DefaultContentNegotiator

The default implementation of IContentNegotiator, which is used to select a MediaTypeFormatter for an HttpRequestMessage or HttpResponseMessage.
public bool ExcludeMatchOnTypeOnly { get; }

If true, exclude formatters that match only on the object type; otherwise, false.

Initializes a new instance of the DefaultContentNegotiator class.

public DefaultContentNegotiator(bool excludeMatchOnTypeOnly)

Initializes a new instance of the DefaultContentNegotiator class.

Determines how well each formatter matches an HTTP request.

Matches a set of Accept header fields against the media types that a formatter supports.

Matches a request against the MediaTypeMapping objects in a media-type formatter.

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

protected virtual MediaTypeFormatterMatch MatchType(Type type, MediaTypeFormatter formatter)

Selects the first supported media type of a formatter.

Performs content negotiating by selecting the most appropriate MediaTypeFormatter out of the passed in formatters for the given request that can serialize an object of the given type.

Determines the best character encoding for writing the response.

Selects the best match among the candidate matches found.

Sorts Accept header values in descending order of q factor.

Sorts a list of Accept-Charset, Accept-Encoding, Accept-Language or related header values in descending order or q factor.

Evaluates whether a match is better than the current match.