HttpProductInfoHeaderValue HttpProductInfoHeaderValue HttpProductInfoHeaderValue HttpProductInfoHeaderValue Class

Definition

Represents product information used in the User-Agent HTTP header on an HTTP request.

public : sealed class HttpProductInfoHeaderValue : IStringable, IHttpProductInfoHeaderValue
public sealed class HttpProductInfoHeaderValue : IStringable, IHttpProductInfoHeaderValue
Public NotInheritable Class HttpProductInfoHeaderValue Implements IStringable, IHttpProductInfoHeaderValue
var httpProductInfoHeaderValue = new httpProductInfoHeaderValue(productComment);
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The HttpProductInfoHeaderValue class represents product information used in the User-Agent HTTP header on an HTTP request.

The User-Agent header contains information about the user agent originating the request. The User-Agent header can contain multiple product tokens, each followed by optional comments which together identify the user agent and any sub-products. By convention, the product identifiers are listed in decreasing order of their significance for identifying the user agent software. Each product identifier consists of a name and optional version.

Each instance of the HttpProductInfoHeaderValue contains either a value for the Product or Comment property, but not both simultaneously.

The UserAgent property on the HttpRequestHeaderCollection returns an HttpProductInfoHeaderValueCollection that contains HttpProductInfoHeaderValue objects.

Constructors

HttpProductInfoHeaderValue(String) HttpProductInfoHeaderValue(String) HttpProductInfoHeaderValue(String) HttpProductInfoHeaderValue(String)

Initializes a new instance of the HttpProductInfoHeaderValue class with a product comment.

public : HttpProductInfoHeaderValue(Platform::String productComment)
public HttpProductInfoHeaderValue(String productComment)
Public Sub New(productComment As String)
var httpProductInfoHeaderValue = new httpProductInfoHeaderValue(productComment);
Parameters
productComment
Platform::String String String String

The product comment used in the User-Agent HTTP header.

See Also

HttpProductInfoHeaderValue(String, String) HttpProductInfoHeaderValue(String, String) HttpProductInfoHeaderValue(String, String) HttpProductInfoHeaderValue(String, String)

Initializes a new instance of the HttpProductInfoHeaderValue class with a product name and version.

public : HttpProductInfoHeaderValue(Platform::String productName, Platform::String productVersion)
public HttpProductInfoHeaderValue(String productName, String productVersion)
Public Sub New(productName As String, productVersion As String)
var httpProductInfoHeaderValue = new httpProductInfoHeaderValue(productName, productVersion);
Parameters
productName
Platform::String String String String

The name of the product token used in the User-Agent HTTP header.

productVersion
Platform::String String String String

The version of the product token used in the User-Agent HTTP header.

See Also

Properties

Comment Comment Comment Comment

Gets the product comment from the HttpProductInfoHeaderValue used in the User-Agent HTTP header.

public : Platform::String Comment { get; }
public string Comment { get; }
Public ReadOnly Property Comment As string
var string = httpProductInfoHeaderValue.comment;
Value
Platform::String string string string

The product comment used in the User-Agent HTTP header.

Product Product Product Product

Gets the product from the HttpProductInfoHeaderValue used in the User-Agent HTTP header.

public : HttpProductHeaderValue Product { get; }
public HttpProductHeaderValue Product { get; }
Public ReadOnly Property Product As HttpProductHeaderValue
var httpProductHeaderValue = httpProductInfoHeaderValue.product;
Value
HttpProductHeaderValue HttpProductHeaderValue HttpProductHeaderValue HttpProductHeaderValue

The product name and version used in the User-Agent HTTP header.

Methods

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

Converts a string to an HttpProductInfoHeaderValue instance.

public : static HttpProductInfoHeaderValue Parse(Platform::String input)
public static HttpProductInfoHeaderValue Parse(String input)
Public Static Function Parse(input As String) As HttpProductInfoHeaderValue
var httpProductInfoHeaderValue = Windows.Web.Http.Headers.HttpProductInfoHeaderValue.parse(input);
Parameters
input
Platform::String String String String

A string that represents the product information.

Returns

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 product information.

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

Returns a string that represents the current HttpProductInfoHeaderValue object.

public : Platform::String ToString()
public string ToString()
Public Function ToString() As string
var string = httpProductInfoHeaderValue.toString();
Returns
Platform::String string string string

A string that represents the current object.

TryParse(String, HttpProductInfoHeaderValue) TryParse(String, HttpProductInfoHeaderValue) TryParse(String, HttpProductInfoHeaderValue) TryParse(String, HttpProductInfoHeaderValue)

Determines whether a string is valid HttpProductInfoHeaderValue information.

public : static Platform::Boolean TryParse(Platform::String input, HttpProductInfoHeaderValue productInfoHeaderValue)
public static bool TryParse(String input, HttpProductInfoHeaderValue productInfoHeaderValue)
Public Static Function TryParse(input As String, productInfoHeaderValue As HttpProductInfoHeaderValue) As bool
var bool = Windows.Web.Http.Headers.HttpProductInfoHeaderValue.tryParse(input, productInfoHeaderValue);
Parameters
input
Platform::String String String String

The string to validate.

Returns
Platform::Boolean bool bool bool

true if input is valid HttpProductInfoHeaderValue information; otherwise, false.