MediaType Struct

Definition

A media type value.

public value class MediaType
public struct MediaType
public readonly struct MediaType
type MediaType = struct
Public Structure MediaType
Inheritance
MediaType

Constructors

MediaType(String)

Initializes a MediaType instance.

MediaType(String, Int32, Nullable<Int32>)

Initializes a Microsoft.AspNetCore.Mvc.Formatters.MediaType.MediaTypeParameterParser instance.

MediaType(StringSegment)

Initializes a MediaType instance.

Properties

Charset

Gets the charset parameter of the MediaType if it has one.

Encoding

Gets the Encoding of the MediaType if it has one.

HasWildcard

Determines whether the current MediaType contains a wildcard.

MatchesAllSubTypes

Gets whether this MediaType matches all subtypes.

MatchesAllSubTypesWithoutSuffix

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

MatchesAllTypes

Gets whether this MediaType matches all types.

SubType

Gets the subtype of the MediaType.

SubTypeSuffix

Gets the structured syntax suffix of the MediaType if it has one.

SubTypeWithoutSuffix

Gets the subtype of the MediaType, excluding any structured syntax suffix.

Type

Gets the type of the MediaType.

Methods

CreateMediaTypeSegmentWithQuality(String, Int32)

Creates an MediaTypeSegmentWithQuality containing the media type in mediaType and its associated quality.

GetEncoding(String)

Get an encoding for a mediaType.

GetEncoding(StringSegment)

Get an encoding for a mediaType.

GetParameter(String)

Gets the parameter parameterName of the media type.

GetParameter(StringSegment)

Gets the parameter parameterName of the media type.

IsSubsetOf(MediaType)

Determines whether the current MediaType is a subset of the setMediaType.

ReplaceEncoding(String, Encoding)

Replaces the encoding of the given mediaType with the provided encoding.

ReplaceEncoding(StringSegment, Encoding)

Replaces the encoding of the given mediaType with the provided encoding.

Applies to