.NET Documentation

ProductInfoHeaderParser Class

System.Net.Http.Headers

Summary

Parses the ProductInfo header for the HTTP protocol.

The ProductInfo header is used by HTTP clients to identify themselves to HTTP servers. It is typically used in the User-Agent header.

Syntax


public sealed class ProductInfoHeaderParser : HttpHeadersParser<ProductInfoHeaderValue>
            

Remarks

This class implements the parser for the ProductInfo header as defined in RFC 7231, Section 5.5.3.

An instance of this class can be used to parse a string representation of a ProductInfo header into one or more ProductInfoHeaderValue objects.

Properties

Instance


public static ProductInfoHeaderParser Instance { get; }
            

Gets the singleton instance of the ProductInfoHeaderParser.

Methods

Parse


public ProductInfoHeaderValue Parse(string input);
            

Parses the specified string into a ProductInfoHeaderValue object.

Parameters

Returns

A ProductInfoHeaderValue object that represents the parsed header value.

ParseAdd


public void ParseAdd(string input, IList<ProductInfoHeaderValue>? system);
            

Parses the specified string and adds the resulting ProductInfoHeaderValue objects to the list of products.

Parameters

See Also