MediaTypeHeaderValue.MatchesMediaType(StringSegment) Method

Definition

Gets a value indicating whether otherMediaType is a subset of this MediaTypeHeaderValue in terms of type/subType. A "subset" is defined as the same or a more specific media type according to the precedence described in https://www.ietf.org/rfc/rfc2068.txt section 14.1, Accept.

public bool MatchesMediaType (Microsoft.Extensions.Primitives.StringSegment otherMediaType);
member this.MatchesMediaType : Microsoft.Extensions.Primitives.StringSegment -> bool
Public Function MatchesMediaType (otherMediaType As StringSegment) As Boolean

Parameters

otherMediaType
StringSegment

The StringSegment to compare.

Returns

A value indicating whether otherMediaType is a subset of this MediaTypeHeaderValue.

Remarks

For example "multipart/mixed" is a subset of "multipart/mixed", "multipart/*", and "*/*" but not "multipart/message."

Applies to