HttpMediaTypeWithQualityHeaderValue
HttpMediaTypeWithQualityHeaderValue
HttpMediaTypeWithQualityHeaderValue
HttpMediaTypeWithQualityHeaderValue
Class
Definition
Represents accept information used in the Accept HTTP header on an HTTP request.
public : sealed class HttpMediaTypeWithQualityHeaderValue : IStringable, IHttpMediaTypeWithQualityHeaderValuepublic sealed class HttpMediaTypeWithQualityHeaderValue : IStringable, IHttpMediaTypeWithQualityHeaderValuePublic NotInheritable Class HttpMediaTypeWithQualityHeaderValue Implements IStringable, IHttpMediaTypeWithQualityHeaderValue// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
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.
Constructors
HttpMediaTypeWithQualityHeaderValue(String) HttpMediaTypeWithQualityHeaderValue(String) HttpMediaTypeWithQualityHeaderValue(String) HttpMediaTypeWithQualityHeaderValue(String)
Initializes a new instance of the HttpMediaTypeHeaderValue class with a media type.
public : HttpMediaTypeWithQualityHeaderValue(PlatForm::String mediaType)public HttpMediaTypeWithQualityHeaderValue(String mediaType)Public Sub New(mediaType As String)// You can use this method in JavaScript.
- mediaType
- PlatForm::String String String String
The media-type of the entity-body to accept that is used in the Accept HTTP header.
- See Also
HttpMediaTypeWithQualityHeaderValue(String, Double) HttpMediaTypeWithQualityHeaderValue(String, Double) HttpMediaTypeWithQualityHeaderValue(String, Double) HttpMediaTypeWithQualityHeaderValue(String, Double)
Initializes a new instance of the HttpMediaTypeHeaderValue class with a media type and quality.
public : HttpMediaTypeWithQualityHeaderValue(PlatForm::String mediaType, double quality)public HttpMediaTypeWithQualityHeaderValue(String mediaType, Double quality)Public Sub New(mediaType As String, quality As Double)// You can use this method in JavaScript.
- mediaType
- PlatForm::String String String String
The media-type of the entity-body to accept that is used in the Accept HTTP header.
- quality
- double Double Double Double
The qvalue or quality.
- See Also
Properties
CharSet CharSet CharSet CharSet
Gets or sets the character set of the content to accept that is used in the Accept HTTP header.
public : PlatForm::String CharSet { get; set; }public string CharSet { get; set; }Public ReadWrite Property CharSet As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The character set of the entity-body.
MediaType MediaType MediaType MediaType
Gets or sets the media-type of the content to accept that is used in the Accept HTTP header.
public : PlatForm::String MediaType { get; set; }public string MediaType { get; set; }Public ReadWrite Property MediaType As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The media-type of the entity-body.
Parameters Parameters Parameters Parameters
Gets a set of parameters included in the Accept HTTP header.
public : IVector<HttpNameValueHeaderValue> Parameters { get; }public IList<HttpNameValueHeaderValue> Parameters { get; }Public ReadOnly Property Parameters As IList<HttpNameValueHeaderValue>// You can use this property in JavaScript.
- Value
- IVector<HttpNameValueHeaderValue> IList<HttpNameValueHeaderValue> IList<HttpNameValueHeaderValue> IList<HttpNameValueHeaderValue>
A set of parameters.
Quality Quality Quality Quality
Get or set the qvalue or quality used in the Accept HTTP header.
public : IReference<double> Quality { get; set; }public Nullable<double> Quality { get; set; }Public ReadWrite Property Quality As Nullable<double>// You can use this property in JavaScript.
- Value
- IReference<double> Nullable<double> Nullable<double> Nullable<double>
The qvalue or quality.
Remarks
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.
Methods
Parse(String) Parse(String) Parse(String) Parse(String)
Converts a string to an HttpMediaTypeWithQualityHeaderValue instance.
public : static HttpMediaTypeWithQualityHeaderValue Parse(PlatForm::String input)public static HttpMediaTypeWithQualityHeaderValue Parse(String input)Public Static Function Parse(input As String) As HttpMediaTypeWithQualityHeaderValue// You can use this method in JavaScript.
- input
- PlatForm::String String String String
A string that represents the media-type, character set, and quality information used in the Accept HTTP header.
An HttpMediaTypeWithQualityHeaderValue instance.
Remarks
Below are the exceptions that this function throws.
E_INVALIDARG
The input parameter is null (Nothing in Visual Basic).
The input parameter is not valid media-type, character set , and quality information.
ToString() ToString() ToString() ToString()
Returns a string that represents the current HttpMediaTypeWithQualityHeaderValue object.
public : PlatForm::String ToString()public string ToString()Public Function ToString() As string// You can use this method in JavaScript.
A string that represents the current object.
TryParse(String, HttpMediaTypeWithQualityHeaderValue) TryParse(String, HttpMediaTypeWithQualityHeaderValue) TryParse(String, HttpMediaTypeWithQualityHeaderValue) TryParse(String, HttpMediaTypeWithQualityHeaderValue)
Determines whether a string is valid HttpMediaTypeWithQualityHeaderValue information.
public : static PlatForm::Boolean TryParse(PlatForm::String input, HttpMediaTypeWithQualityHeaderValue mediaTypeWithQualityHeaderValue)public static bool TryParse(String input, HttpMediaTypeWithQualityHeaderValue mediaTypeWithQualityHeaderValue)Public Static Function TryParse(input As String, mediaTypeWithQualityHeaderValue As HttpMediaTypeWithQualityHeaderValue) As bool// You can use this method in JavaScript.
- input
- PlatForm::String String String String
The string to validate.
- mediaTypeWithQualityHeaderValue
- HttpMediaTypeWithQualityHeaderValue HttpMediaTypeWithQualityHeaderValue HttpMediaTypeWithQualityHeaderValue HttpMediaTypeWithQualityHeaderValue
The HttpMediaTypeWithQualityHeaderValue version of the string.
true if input is valid HttpMediaTypeWithQualityHeaderValue information; otherwise, false.