DefaultContentNegotiator.MatchAcceptHeader Method
Matches a set of Accept header fields against the media types that a formatter supports.
Namespace: System.Net.Http.Formatting
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
Protected Overridable Function MatchAcceptHeader ( _
sortedAcceptValues As IEnumerable(Of MediaTypeWithQualityHeaderValue), _
formatter As MediaTypeFormatter _
) As MediaTypeFormatterMatch
'Usage
Dim sortedAcceptValues As IEnumerable(Of MediaTypeWithQualityHeaderValue)
Dim formatter As MediaTypeFormatter
Dim returnValue As MediaTypeFormatterMatch
returnValue = Me.MatchAcceptHeader(sortedAcceptValues, _
formatter)
protected virtual MediaTypeFormatterMatch MatchAcceptHeader(
IEnumerable<MediaTypeWithQualityHeaderValue> sortedAcceptValues,
MediaTypeFormatter formatter
)
protected:
virtual MediaTypeFormatterMatch^ MatchAcceptHeader(
IEnumerable<MediaTypeWithQualityHeaderValue^>^ sortedAcceptValues,
MediaTypeFormatter^ formatter
)
abstract MatchAcceptHeader :
sortedAcceptValues:IEnumerable<MediaTypeWithQualityHeaderValue> *
formatter:MediaTypeFormatter -> MediaTypeFormatterMatch
override MatchAcceptHeader :
sortedAcceptValues:IEnumerable<MediaTypeWithQualityHeaderValue> *
formatter:MediaTypeFormatter -> MediaTypeFormatterMatch
protected function MatchAcceptHeader(
sortedAcceptValues : IEnumerable<MediaTypeWithQualityHeaderValue>,
formatter : MediaTypeFormatter
) : MediaTypeFormatterMatch
Parameters
sortedAcceptValues
Type: System.Collections.Generic.IEnumerable<MediaTypeWithQualityHeaderValue>A list of Accept header values, sorted in descending order of q factor. You can create this list by calling the SortMediaTypeWithQualityHeaderValuesByQFactor method.
formatter
Type: System.Net.Http.Formatting.MediaTypeFormatterThe 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.