Skip to main content
HttpMediaTypeHeaderValue class

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

Syntax


var httpMediaTypeHeaderValue = new Windows.Web.Http.Headers.HttpMediaTypeHeaderValue();

public sealed class HttpMediaTypeHeaderValue : IStringable

Public NotInheritable Class HttpMediaTypeHeaderValue
    Implements IStringable

public ref class HttpMediaTypeHeaderValue sealed : IStringable

Members

The HttpMediaTypeHeaderValue class has these types of members:

Constructors

The HttpMediaTypeHeaderValue class has these constructors.

ConstructorDescription
HttpMediaTypeHeaderValue Initializes a new instance of the HttpMediaTypeHeaderValue class.

 

Methods

The HttpMediaTypeHeaderValue class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
Parse Converts a string to an HttpMediaTypeHeaderValue instance.
ToString Returns a string that represents the current HttpMediaTypeHeaderValue object.
TryParse Determines whether a string is valid HttpMediaTypeHeaderValue information.

 

Properties

The HttpMediaTypeHeaderValue class has these properties.

PropertyAccess typeDescription

CharSet

Read/write

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

MediaType

Read/write

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

Parameters

Read-only

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

 

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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Web.Http.Headers
Windows::Web::Http::Headers [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Web.Http.Headers
Windows::Web::Http::Headers [C++]

Metadata

Windows.winmd

Attributes

[ DualApiPartition()]
[ MarshalingBehavior(Agile)]
[ Threading(Both)]
[ Version(0x06030000)]

See also

ContentType
HttpContentHeaderCollection
IStringable
Object