HttpLanguageRangeWithQualityHeaderValue HttpLanguageRangeWithQualityHeaderValue HttpLanguageRangeWithQualityHeaderValue HttpLanguageRangeWithQualityHeaderValue HttpLanguageRangeWithQualityHeaderValue Class

Definition

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

public : sealed class HttpLanguageRangeWithQualityHeaderValue : IStringable
struct winrt::Windows::Web::Http::Headers::HttpLanguageRangeWithQualityHeaderValue : IStringable
public sealed class HttpLanguageRangeWithQualityHeaderValue : IStringable
Public NotInheritable Class HttpLanguageRangeWithQualityHeaderValue Implements IStringable
var httpLanguageRangeWithQualityHeaderValue = new httpLanguageRangeWithQualityHeaderValue(languageRange);
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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.

Constructors

HttpLanguageRangeWithQualityHeaderValue(String) HttpLanguageRangeWithQualityHeaderValue(String) HttpLanguageRangeWithQualityHeaderValue(String) HttpLanguageRangeWithQualityHeaderValue(String) HttpLanguageRangeWithQualityHeaderValue(String)

Initializes a new instance of the HttpLanguageRangeWithQualityHeaderValue class with language-range information.

HttpLanguageRangeWithQualityHeaderValue(String, Double) HttpLanguageRangeWithQualityHeaderValue(String, Double) HttpLanguageRangeWithQualityHeaderValue(String, Double) HttpLanguageRangeWithQualityHeaderValue(String, Double) HttpLanguageRangeWithQualityHeaderValue(String, Double)

Initializes a new instance of the HttpLanguageRangeWithQualityHeaderValue class with language-range and quality information.

Properties

LanguageRange LanguageRange LanguageRange LanguageRange LanguageRange

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

Quality Quality Quality Quality Quality

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

Methods

Parse(String) Parse(String) Parse(String) Parse(String) Parse(String)

Converts a string to an HttpLanguageRangeWithQualityHeaderValue instance.

ToString() ToString() ToString() ToString() ToString()

Returns a string that represents the current HttpLanguageRangeWithQualityHeaderValue object.

TryParse(String, HttpLanguageRangeWithQualityHeaderValue) TryParse(String, HttpLanguageRangeWithQualityHeaderValue) TryParse(String, HttpLanguageRangeWithQualityHeaderValue) TryParse(String, HttpLanguageRangeWithQualityHeaderValue) TryParse(String, HttpLanguageRangeWithQualityHeaderValue)

Determines whether a string is valid HttpLanguageRangeWithQualityHeaderValue information.

See also