HttpMediaTypeHeaderValue Class

Definition

Represents the value of the Content-Type HTTP header on the HTTP content in a request or a response.

public ref class HttpMediaTypeHeaderValue sealed : IStringable
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.Headers.IHttpMediaTypeHeaderValueFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class HttpMediaTypeHeaderValue final : IStringable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.Headers.IHttpMediaTypeHeaderValueFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpMediaTypeHeaderValue final : IStringable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.Headers.IHttpMediaTypeHeaderValueFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class HttpMediaTypeHeaderValue : IStringable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.Headers.IHttpMediaTypeHeaderValueFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpMediaTypeHeaderValue : IStringable
function HttpMediaTypeHeaderValue(mediaType)
Public NotInheritable Class HttpMediaTypeHeaderValue
Implements IStringable
Inheritance
Object Platform::Object IInspectable HttpMediaTypeHeaderValue
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The HttpMediaTypeHeaderValue class represents the value of the Content-Type HTTP header on HTTP content sent in an HTTP request or received in an HTTP response.

The ContentType property on the HttpContentHeaderCollection returns an HttpMediaTypeHeaderValue object.

Constructors

HttpMediaTypeHeaderValue(String)

Initializes a new instance of the HttpMediaTypeHeaderValue class.

Properties

CharSet

Gets or sets the character set of the entity-body used in the Content-Type HTTP header.

MediaType

Gets or sets the media-type of the entity-body used in the Content-Type HTTP header.

Parameters

Gets a set of parameters included in the Content-Type HTTP header.

Methods

Parse(String)

Converts a string to an HttpMediaTypeHeaderValue instance.

ToString()

Returns a string that represents the current HttpMediaTypeHeaderValue object.

TryParse(String, HttpMediaTypeHeaderValue)

Determines whether a string is valid HttpMediaTypeHeaderValue information.

Applies to

See also