MediaTypeHeaderValue MediaTypeHeaderValue MediaTypeHeaderValue Class

Definition

Representation of the media type header. See .

public class MediaTypeHeaderValue
type MediaTypeHeaderValue = class
Public Class MediaTypeHeaderValue
Inheritance
MediaTypeHeaderValueMediaTypeHeaderValueMediaTypeHeaderValue

Constructors

MediaTypeHeaderValue(StringSegment) MediaTypeHeaderValue(StringSegment) MediaTypeHeaderValue(StringSegment)

Initializes a MediaTypeHeaderValue instance.

MediaTypeHeaderValue(String) MediaTypeHeaderValue(String) MediaTypeHeaderValue(String)
MediaTypeHeaderValue(StringSegment, Double) MediaTypeHeaderValue(StringSegment, Double) MediaTypeHeaderValue(StringSegment, Double)

Initializes a MediaTypeHeaderValue instance.

MediaTypeHeaderValue(String, Double) MediaTypeHeaderValue(String, Double) MediaTypeHeaderValue(String, Double)

Properties

Boundary Boundary Boundary

Gets or sets the value of the boundary parameter. Returns Empty if there is no boundary.

Charset Charset Charset

Gets or sets the value of the charset parameter. Returns Empty if there is no charset.

Encoding Encoding Encoding

Gets or sets the value of the Encoding parameter. Setting the Encoding will set the Charset to WebName.

Facets Facets Facets

Get a IList<T> of facets of the MediaTypeHeaderValue. Facets are a period separated list of StringSegments in the SubTypeWithoutSuffix. See The RFC documentation on facets.

IsReadOnly IsReadOnly IsReadOnly

Gets whether the MediaTypeHeaderValue is readonly.

MatchesAllSubTypes MatchesAllSubTypes MatchesAllSubTypes

Gets whether this MediaTypeHeaderValue matches all subtypes.

MatchesAllSubTypesWithoutSuffix MatchesAllSubTypesWithoutSuffix MatchesAllSubTypesWithoutSuffix

Gets whether this MediaTypeHeaderValue matches all subtypes, ignoring any structured syntax suffix.

MatchesAllTypes MatchesAllTypes MatchesAllTypes

Gets whether this MediaTypeHeaderValue matches all types.

MediaType MediaType MediaType

Gets or sets the value of the media type. Returns Empty if there is no media type.

Parameters Parameters Parameters

Gets or sets the media type's parameters. Returns an empty IList<T> if there are no parameters.

Quality Quality Quality

Gets or sets the value of the quality parameter. Returns null if there is no quality.

SubType SubType SubType

Gets the subtype of the MediaTypeHeaderValue.

SubTypeWithoutSuffix SubTypeWithoutSuffix SubTypeWithoutSuffix

Gets subtype of the MediaTypeHeaderValue, excluding any structured syntax suffix. Returns Empty if there is no subtype without suffix.

Suffix Suffix Suffix

Gets the structured syntax suffix of the MediaTypeHeaderValue if it has one. See The RFC documentation on structured syntaxes.

Type Type Type

Gets the type of the MediaTypeHeaderValue.

Methods

Copy() Copy() Copy()

Performs a deep copy of this object and all of it's NameValueHeaderValue sub components, while avoiding the cost of re-validating the components.

CopyAsReadOnly() CopyAsReadOnly() CopyAsReadOnly()

Performs a deep copy of this object and all of it's NameValueHeaderValue sub components, while avoiding the cost of re-validating the components. This copy is read-only.

Equals(Object) Equals(Object) Equals(Object)
GetHashCode() GetHashCode() GetHashCode()
IsSubsetOf(MediaTypeHeaderValue) IsSubsetOf(MediaTypeHeaderValue) IsSubsetOf(MediaTypeHeaderValue)

Gets a value indicating whether this MediaTypeHeaderValue is a subset of otherMediaType. 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.

Parse(StringSegment) Parse(StringSegment) Parse(StringSegment)

Takes a media type and parses it into the MediaTypeHeaderValue and its associated parameters.

Parse(String) Parse(String) Parse(String)
ParseList(IList<String>) ParseList(IList<String>) ParseList(IList<String>)

Takes an IList<T> of String and parses it into the MediaTypeHeaderValue and its associated parameters.

ParseStrictList(IList<String>) ParseStrictList(IList<String>) ParseStrictList(IList<String>)

Takes an IList<T> of String and parses it into the MediaTypeHeaderValue and its associated parameters. Throws if there is invalid data in a string.

ToString() ToString() ToString()
TryParse(StringSegment, MediaTypeHeaderValue) TryParse(StringSegment, MediaTypeHeaderValue) TryParse(StringSegment, MediaTypeHeaderValue)

Takes a media type, which can include parameters, and parses it into the MediaTypeHeaderValue and its associated parameters.

TryParse(String, MediaTypeHeaderValue) TryParse(String, MediaTypeHeaderValue) TryParse(String, MediaTypeHeaderValue)
TryParseList(IList<String>, IList<MediaTypeHeaderValue>) TryParseList(IList<String>, IList<MediaTypeHeaderValue>) TryParseList(IList<String>, IList<MediaTypeHeaderValue>)

Takes an IList<T> of String and parses it into the MediaTypeHeaderValue and its associated parameters.

TryParseStrictList(IList<String>, IList<MediaTypeHeaderValue>) TryParseStrictList(IList<String>, IList<MediaTypeHeaderValue>) TryParseStrictList(IList<String>, IList<MediaTypeHeaderValue>)

Takes an IList<T> of String and parses it into the MediaTypeHeaderValue and its associated parameters.

Applies to