HttpProductInfoHeaderValue 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
struct winrt::Windows::Web::Http::Headers::HttpProductInfoHeaderValue : IStringable
public sealed class HttpProductInfoHeaderValue : IStringable
Public NotInheritable Class HttpProductInfoHeaderValue Implements IStringable
var httpProductInfoHeaderValue = new httpProductInfoHeaderValue(productName, productVersion);
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) HttpProductInfoHeaderValue(String)

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

HttpProductInfoHeaderValue(String, String) 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.

Properties

Comment Comment Comment Comment Comment

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

Product Product Product Product Product

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

Methods

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

Converts a string to an HttpProductInfoHeaderValue instance.

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

Returns a string that represents the current HttpProductInfoHeaderValue object.

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

Determines whether a string is valid HttpProductInfoHeaderValue information.

See also