MediaTypeHeaderValue.MatchesMediaType(StringSegment) 方法

定义

获取一个值,该值指示是否 otherMediaType 是此 MediaTypeHeaderValue 类型/subType 的子集。 根据第 14.1 节“接受”中所述 https://www.ietf.org/rfc/rfc2068.txt 的优先级,将“子集”定义为相同或更具体的媒体类型。

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

参数

otherMediaType
StringSegment

要比较的 StringSegment

返回

一个 值,该值指示是否 otherMediaType 是此 MediaTypeHeaderValue的子集。

注解

例如,“multipart/mixed”是“multipart/mixed”、“multipart/*”和“*/*”的子集,但不是“multipart/message”。

适用于