Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HttpLanguageRangeWithQualityHeaderValue class

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

Syntax


var httpLanguageRangeWithQualityHeaderValue = new Windows.Web.Http.Headers.HttpLanguageRangeWithQualityHeaderValue(string);
var httpLanguageRangeWithQualityHeaderValue = new Windows.Web.Http.Headers.HttpLanguageRangeWithQualityHeaderValue(string, double);

Members

The HttpLanguageRangeWithQualityHeaderValue class has these types of members:

Constructors

The HttpLanguageRangeWithQualityHeaderValue class has these constructors.

ConstructorDescription
HttpLanguageRangeWithQualityHeaderValue(String) Initializes a new instance of the HttpLanguageRangeWithQualityHeaderValue class with language-range information.
HttpLanguageRangeWithQualityHeaderValue(String, Double) Initializes a new instance of the HttpLanguageRangeWithQualityHeaderValue class with language-range and quality information.

 

Methods

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

 

Properties

The HttpLanguageRangeWithQualityHeaderValue class has these properties.

PropertyAccess typeDescription

LanguageRange

Read-onlyGets the value of the language-range information from the HttpLanguageRangeWithQualityHeaderValue used in the Accept-Language HTTP header.

Quality

Read-onlyGets the value of the qvalue or quality factor from the HttpLanguageRangeWithQualityHeaderValue used in the Accept-Language HTTP header.

 

Remarks

The HttpLanguageRangeWithQualityHeaderValue class represents accept language information used in the Accept-Language HTTP header on an HTTP request.

The Accept-Language header can be used by clients to indicate the set of natural languages that are preferred in the response. A language range is defined in IETF RFC 4647. It is a language tag, or partial language tag, indicating a language, or range of languages. For example en-us would be American English, and en-gb would be British English. While en is a language range, meaning any variation of English.

Each language-range can be given an associated quality value representing an estimate of the user's preference for the languages specified by that range. The quality must be in the range 0.0 to 1.0.

Some recipients treat the order in which language tags are listed as an indication of descending priority, particularly for tags that are assigned equal quality values (no value is the same as q=1). However, this behavior cannot be relied upon. For consistency and to maximize interoperability, many user agents assign each language tag a unique quality value while also listing them in order of decreasing quality.

The AcceptLanguage property on the HttpRequestHeaderCollection returns an HttpLanguageRangeWithQualityHeaderValueCollection that contains HttpLanguageRangeWithQualityHeaderValue objects.

Requirements (Windows 10 device family)

Device family

Universal

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

AcceptLanguage
HttpLanguageRangeWithQualityHeaderValueCollection
HttpRequestHeaderCollection
Object
IStringable

 

 

Show:
© 2015 Microsoft