Skip to main content
HttpMediaTypeWithQualityHeaderValue class

Represents accept information used in the Accept HTTP header on an HTTP request.

Syntax


var httpMediaTypeWithQualityHeaderValue = new Windows.Web.Http.Headers.HttpMediaTypeWithQualityHeaderValue(string);
var httpMediaTypeWithQualityHeaderValue = new Windows.Web.Http.Headers.HttpMediaTypeWithQualityHeaderValue(string, double);

public sealed class HttpMediaTypeWithQualityHeaderValue : IStringable

Public NotInheritable Class HttpMediaTypeWithQualityHeaderValue
    Implements IStringable

public ref class HttpMediaTypeWithQualityHeaderValue sealed : IStringable

Members

The HttpMediaTypeWithQualityHeaderValue class has these types of members:

Constructors

The HttpMediaTypeWithQualityHeaderValue class has these constructors.

ConstructorDescription
HttpMediaTypeWithQualityHeaderValue(String) Initializes a new instance of the HttpMediaTypeHeaderValue class with a media type.
HttpMediaTypeWithQualityHeaderValue(String, Double) Initializes a new instance of the HttpMediaTypeHeaderValue class with a media type and quality.

 

Methods

The HttpMediaTypeWithQualityHeaderValue 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 HttpMediaTypeWithQualityHeaderValue instance.
ToString Returns a string that represents the current HttpMediaTypeWithQualityHeaderValue object.
TryParse Determines whether a string is valid HttpMediaTypeWithQualityHeaderValue information.

 

Properties

The HttpMediaTypeWithQualityHeaderValue class has these properties.

PropertyAccess typeDescription

CharSet

Read/write

Gets or sets the character set of the content to accept that is used in the Accept HTTP header.

MediaType

Read/write

Gets or sets the media-type of the content to accept that is used in the Accept HTTP header.

Parameters

Read-only

Gets a set of parameters included in the Accept HTTP header.

Quality

Read/write

Get or set the qvalue or quality used in the Accept HTTP header.

 

Remarks

The HttpMediaTypeWithQualityHeaderValue class represents accept information used in the Accept HTTP header on an HTTP request.

The Accept property on the HttpRequestHeaderCollection returns an HttpMediaTypeWithQualityHeaderValueCollection that contains HttpMediaTypeWithQualityHeaderValue objects.

The Quality property represents the quality factor that allows the user agent to indicate the relative degree of preference for the media type in a header. Quality uses a scale from 0 to 1. The default value is q=1.

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

Accept
HttpMediaTypeWithQualityHeaderValueCollection
HttpRequestHeaderCollection
Object
IStringable