Http​Product​Info​Header​Value Http​Product​Info​Header​Value Http​Product​Info​Header​Value Class

Definition

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

public sealed class HttpProductInfoHeaderValue : IStringable, IHttpProductInfoHeaderValuepublic sealed class HttpProductInfoHeaderValue : IStringable, IHttpProductInfoHeaderValuePublic NotInheritable Class HttpProductInfoHeaderValue Implements IStringable, IHttpProductInfoHeaderValue
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)

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

public HttpProductInfoHeaderValue(String productComment)public HttpProductInfoHeaderValue(String productComment)Public Sub New(productComment As String)
Parameters
productComment
System.String System.String System.String

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

Attributes

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(String productName, String productVersion)public HttpProductInfoHeaderValue(String productName, String productVersion)Public Sub New(productName As String, productVersion As String)
Parameters
productName
System.String System.String System.String

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

productVersion
System.String System.String System.String

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

Attributes

Properties

Comment Comment Comment

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

public string Comment { get; }public string Comment { get; }Public ReadOnly Property Comment As string
Value
string string string

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

Attributes

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
Value
HttpProductHeaderValue HttpProductHeaderValue HttpProductHeaderValue

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

Attributes

Methods

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

Converts a string to an HttpProductInfoHeaderValue instance.

public static HttpProductInfoHeaderValue Parse(String input)public static HttpProductInfoHeaderValue Parse(String input)Public Static Function Parse(input As String) As HttpProductInfoHeaderValue
Parameters
input
System.String System.String System.String

A string that represents the product information.

Returns
Attributes

ToString() ToString() ToString()

Returns a string that represents the current HttpProductInfoHeaderValue object.

public string ToString()public string ToString()Public Function ToString() As string
Returns
string string string

A string that represents the current object.

Attributes

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

Determines whether a string is valid HttpProductInfoHeaderValue information.

public static bool TryParse(String input, HttpProductInfoHeaderValue productInfoHeaderValue)public static bool TryParse(String input, HttpProductInfoHeaderValue productInfoHeaderValue)Public Static Function TryParse(input As String, productInfoHeaderValue As HttpProductInfoHeaderValue) As bool
Parameters
input
System.String System.String System.String

The string to validate.

Returns
bool bool bool

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

Attributes