HttpNameValueHeaderValue HttpNameValueHeaderValue HttpNameValueHeaderValue HttpNameValueHeaderValue Class

Definition

Represents name and value information used in a number of HTTP headers.

public : sealed class HttpNameValueHeaderValue : IStringable, IHttpNameValueHeaderValue
public sealed class HttpNameValueHeaderValue : IStringable, IHttpNameValueHeaderValue
Public NotInheritable Class HttpNameValueHeaderValue Implements IStringable, IHttpNameValueHeaderValue
var httpNameValueHeaderValue = new httpNameValueHeaderValue(name);
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The HttpNameValueHeaderValue class provides support for name/value pairs used in various headers

Constructors

HttpNameValueHeaderValue(String) HttpNameValueHeaderValue(String) HttpNameValueHeaderValue(String) HttpNameValueHeaderValue(String)

Initializes a new instance of the HttpNameValueHeaderValue class. with a name.

public : HttpNameValueHeaderValue(Platform::String name)
public HttpNameValueHeaderValue(String name)
Public Sub New(name As String)
var httpNameValueHeaderValue = new httpNameValueHeaderValue(name);
Parameters
name
Platform::String String String String

The name to be used.

See Also

HttpNameValueHeaderValue(String, String) HttpNameValueHeaderValue(String, String) HttpNameValueHeaderValue(String, String) HttpNameValueHeaderValue(String, String)

Initializes a new instance of the HttpNameValueHeaderValue class. with a name and value.

public : HttpNameValueHeaderValue(Platform::String name, Platform::String value)
public HttpNameValueHeaderValue(String name, String value)
Public Sub New(name As String, value As String)
var httpNameValueHeaderValue = new httpNameValueHeaderValue(name, value);
Parameters
name
Platform::String String String String

The name to be used.

value
Platform::String String String String

The value to associate with the name.

See Also

Properties

Name Name Name Name

Gets the name used in the HttpNameValueHeaderValue object.

public : Platform::String Name { get; }
public string Name { get; }
Public ReadOnly Property Name As string
var string = httpNameValueHeaderValue.name;
Value
Platform::String string string string

The name used in the HttpNameValueHeaderValue object.

Value Value Value Value

Gets or sets the value associated with a name used in the HttpNameValueHeaderValue object.

public : Platform::String Value { get; set; }
public string Value { get; set; }
Public ReadWrite Property Value As string
var string = httpNameValueHeaderValue.value;
httpNameValueHeaderValue.value = string;
Value
Platform::String string string string

The value associated with a name used in the HttpNameValueHeaderValue object.

Methods

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

Converts a string to an HttpNameValueHeaderValue instance.

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

A string that represents the name and value.

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 name and value information.

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

Returns a string that represents the current HttpNameValueHeaderValue object.

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

A string that represents the current object.

TryParse(String, HttpNameValueHeaderValue) TryParse(String, HttpNameValueHeaderValue) TryParse(String, HttpNameValueHeaderValue) TryParse(String, HttpNameValueHeaderValue)

Determines whether a string is valid HttpNameValueHeaderValue information.

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

The string to validate.

Returns
Platform::Boolean bool bool bool

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