Compartilhar via


DefaultContentNegotiator Class

The default implementation of IContentNegotiator, which is used to select a MediaTypeFormatter for an HttpRequestMessage or HttpResponseMessage.

Inheritance Hierarchy

System.Object
  System.Net.Http.Formatting.DefaultContentNegotiator

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

Syntax

'Declaration
Public Class DefaultContentNegotiator _
    Implements IContentNegotiator
'Usage
Dim instance As DefaultContentNegotiator
public class DefaultContentNegotiator : IContentNegotiator
public ref class DefaultContentNegotiator : IContentNegotiator
type DefaultContentNegotiator =  
    class 
        interface IContentNegotiator 
    end
public class DefaultContentNegotiator implements IContentNegotiator

The DefaultContentNegotiator type exposes the following members.

Constructors

  Name Description
Public method DefaultContentNegotiator() Initializes a new instance of the DefaultContentNegotiator class.
Public method DefaultContentNegotiator(Boolean) Initializes a new instance of the DefaultContentNegotiator class.

Top

Properties

  Name Description
Public property ExcludeMatchOnTypeOnly If true, exclude formatters that match only on the object type; otherwise, false.

Top

Methods

  Name Description
Protected method ComputeFormatterMatches Determines how well each formatter matches an HTTP request.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MatchAcceptHeader Matches a set of Accept header fields against the media types that a formatter supports.
Protected method MatchMediaTypeMapping Matches a request against the MediaTypeMapping objects in a media-type formatter.
Protected method MatchRequestMediaType Match the content type of a request against the media types that a formatter supports.
Protected method MatchType Selects the first supported media type of a formatter.
Protected method MemberwiseClone (Inherited from Object.)
Public method Negotiate 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.
Protected method SelectResponseCharacterEncoding Determines the best character encoding for writing the response.
Protected method SelectResponseMediaTypeFormatter Selects the best match among the candidate matches found.
Protected method SortMediaTypeWithQualityHeaderValuesByQFactor Sorts Accept header values in descending order of q factor.
Protected method SortStringWithQualityHeaderValuesByQFactor Sorts a list of Accept-Charset, Accept-Encoding, Accept-Language or related header values in descending order or q factor.
Public method ToString (Inherited from Object.)
Protected method UpdateBestMatch Evaluates whether a match is better than the current match.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Net.Http.Formatting Namespace