共用方式為


HttpMethodHeaderValueCollection 類別

定義

表示 HTTP 回應上 允許 HTTP 標頭的值。

public ref class HttpMethodHeaderValueCollection sealed : IIterable<HttpMethod ^>, IVector<HttpMethod ^>, 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)]
class HttpMethodHeaderValueCollection final : IIterable<HttpMethod>, IVector<HttpMethod>, IStringable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class HttpMethodHeaderValueCollection final : IIterable<HttpMethod>, IVector<HttpMethod>, 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)]
public sealed class HttpMethodHeaderValueCollection : IEnumerable<HttpMethod>, IList<HttpMethod>, IStringable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class HttpMethodHeaderValueCollection : IEnumerable<HttpMethod>, IList<HttpMethod>, IStringable
Public NotInheritable Class HttpMethodHeaderValueCollection
Implements IEnumerable(Of HttpMethod), IList(Of HttpMethod), IStringable
繼承
Object Platform::Object IInspectable HttpMethodHeaderValueCollection
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

HttpMethodHeaderValueCollection 類別代表 HTTP 回應上的 允許 HTTP 標頭。

HttpResponseHeaderCollection上的Allow屬性會傳回 HttpMethodHeaderValueCollection 物件。

屬性

Size

取得集合中的 HttpMethod 物件數目。

方法

Append(HttpMethod)

將新的 HttpMethod 專案加入至集合結尾。

Clear()

從集合中移除所有物件。

First()

擷取反覆運算器至集合中的第一個 HttpMethod 專案。

GetAt(UInt32)

傳回集合中指定索引處的 HttpMethod

GetMany(UInt32, HttpMethod[])

擷取從集合中指定索引處開始的 HttpMethod 專案。

GetView()

傳回 HttpMethodHeaderValueCollection的不可變檢視。

IndexOf(HttpMethod, UInt32)

擷取集合中 HttpMethod 的索引。

InsertAt(UInt32, HttpMethod)

HttpMethod 插入集合中指定的索引處。

ParseAdd(String)

剖析並新增專案至 HttpMethodHeaderValueCollection

RemoveAt(UInt32)

HttpMethodHeaderValueCollection中移除位於指定索引處的專案。

RemoveAtEnd()

從集合中移除最後一個 HttpMethod 專案。

ReplaceAll(HttpMethod[])

以指定的 HttpMethod 專案取代集合中的所有 HttpMethod 專案。

SetAt(UInt32, HttpMethod)

設定集合中指定索引處的 HttpMethod

ToString()

會傳回代表目前 HttpMethodHeaderValueCollection 物件的字串。

TryParseAdd(String)

嘗試剖析並新增指定的專案至 HttpMethodHeaderValueCollection

適用於

另請參閱