HttpLanguageRangeWithQualityHeaderValue Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents accept language information used in the Accept-Language HTTP header on an HTTP request.
public ref class HttpLanguageRangeWithQualityHeaderValue sealed : IStringable
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.Headers.IHttpLanguageRangeWithQualityHeaderValueFactory, 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 HttpLanguageRangeWithQualityHeaderValue 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.IHttpLanguageRangeWithQualityHeaderValueFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpLanguageRangeWithQualityHeaderValue final : IStringable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.Headers.IHttpLanguageRangeWithQualityHeaderValueFactory), 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 HttpLanguageRangeWithQualityHeaderValue : 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.IHttpLanguageRangeWithQualityHeaderValueFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpLanguageRangeWithQualityHeaderValue : IStringable
function HttpLanguageRangeWithQualityHeaderValue(languageRange, quality)
Public NotInheritable Class HttpLanguageRangeWithQualityHeaderValue
Implements IStringable
- Inheritance
- Attributes
- Implements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
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.
Http |
Initializes a new instance of the HttpLanguageRangeWithQualityHeaderValue class with language-range and quality information. |
Http |
Initializes a new instance of the HttpLanguageRangeWithQualityHeaderValue class with language-range information. |
Language |
Gets the value of the language-range information from the HttpLanguageRangeWithQualityHeaderValue used in the Accept-Language HTTP header. |
Quality |
Gets the value of the qvalue or quality factor from the HttpLanguageRangeWithQualityHeaderValue used in the Accept-Language HTTP header. |
Parse(String) |
Converts a string to an HttpLanguageRangeWithQualityHeaderValue instance. |
To |
Returns a string that represents the current HttpLanguageRangeWithQualityHeaderValue object. |
Try |
Determines whether a string is valid HttpLanguageRangeWithQualityHeaderValue information. |
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |