HttpNameValueHeaderValue 类

定义

表示在多个 HTTP 标头中使用的名称和值信息。

public ref class HttpNameValueHeaderValue sealed : IStringable
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.Headers.IHttpNameValueHeaderValueFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class HttpNameValueHeaderValue final : IStringable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.Headers.IHttpNameValueHeaderValueFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpNameValueHeaderValue final : IStringable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.Headers.IHttpNameValueHeaderValueFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class HttpNameValueHeaderValue : IStringable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.Headers.IHttpNameValueHeaderValueFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpNameValueHeaderValue : IStringable
function HttpNameValueHeaderValue(name, value)
Public NotInheritable Class HttpNameValueHeaderValue
Implements IStringable
继承
Object Platform::Object IInspectable HttpNameValueHeaderValue
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

HttpNameValueHeaderValue 类支持各种标头中使用的名称/值对

构造函数

HttpNameValueHeaderValue(String)

初始化 HttpNameValueHeaderValue 类的新实例。 替换为名称。

HttpNameValueHeaderValue(String, String)

初始化 HttpNameValueHeaderValue 类的新实例。 具有名称和值。

属性

Name

获取 在 HttpNameValueHeaderValue 对象中使用的名称。

Value

获取或设置与 HttpNameValueValue 对象中使用的名称关联的值。

方法

Parse(String)

将字符串转换为 HttpNameValueHeaderValue 实例。

ToString()

返回表示当前 HttpNameValueHeaderValue 对象的字符串。

TryParse(String, HttpNameValueHeaderValue)

确定字符串是否为有效的 HttpNameValueHeaderValue 信息。

适用于

另请参阅