HttpMethodHeaderValueCollection HttpMethodHeaderValueCollection HttpMethodHeaderValueCollection HttpMethodHeaderValueCollection Class

Definition

Represents the value of the Allow HTTP header on an HTTP response.

public sealed class HttpMethodHeaderValueCollectionpublic sealed class HttpMethodHeaderValueCollectionPublic NotInheritable Class HttpMethodHeaderValueCollectionpublic sealed class HttpMethodHeaderValueCollection
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The HttpMethodHeaderValueCollection class represents the Allow HTTP header on an HTTP response.

The Allow property on the HttpResponseHeaderCollection returns an HttpMethodHeaderValueCollection object.

Properties

Size Size Size Size

Gets the number of HttpMethod objects in the collection.

public uint Size { get; }public uint Size { get; }Public ReadOnly Property Size As uintpublic uint Size { get; }
Value
uint uint uint uint

The number of HttpMethod objects in the HttpMethodHeaderValueCollection.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

Append(HttpMethod) Append(HttpMethod) Append(HttpMethod) Append(HttpMethod)

Adds a new HttpMethod item to the end of the collection.

public void Append(HttpMethod value)public void Append(HttpMethod value)Public Function Append(value As HttpMethod) As voidpublic void Append(HttpMethod value)
Parameters
value
HttpMethod HttpMethod HttpMethod HttpMethod

The new item to add.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Clear() Clear() Clear() Clear()

Removes all objects from the collection.

public void Clear()public void Clear()Public Function Clear() As voidpublic void Clear()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

First() First() First() First()

Retrieves an iterator to the first HttpMethod item in the collection.

public IIterator<HttpMethod> First()public IIterator<HttpMethod> First()Public Function First() As IIterator( Of HttpMethod )public IIterator<HttpMethod> First()
Returns

An object that can be used to enumerate the HttpMethod items in the collection. The iterator points to the first HttpMethod item in the HttpMethodHeaderValueCollection.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)

Returns the HttpMethod at the specified index in the collection.

public HttpMethod GetAt(UInt32 index)public HttpMethod GetAt(UInt32 index)Public Function GetAt(index As UInt32) As HttpMethodpublic HttpMethod GetAt(UInt32 index)
Parameters
index
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The zero-based index of a specified item in the collection.

Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

GetMany(UInt32, HttpMethod[]) GetMany(UInt32, HttpMethod[]) GetMany(UInt32, HttpMethod[]) GetMany(UInt32, HttpMethod[])

Retrieves the HttpMethod items that start at the specified index in the collection.

public uint GetMany(UInt32 startIndex, HttpMethod[] items)public uint GetMany(UInt32 startIndex, HttpMethod[] items)Public Function GetMany(startIndex As UInt32, items As HttpMethod[]) As uintpublic uint GetMany(UInt32 startIndex, HttpMethod[] items)
Parameters
startIndex
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The zero-based index of the start of the HttpMethod items in the HttpMethodHeaderValueCollection.

items
Windows.Web.Http.HttpMethod[] Windows.Web.Http.HttpMethod[] Windows.Web.Http.HttpMethod[] Windows.Web.Http.HttpMethod[]

An array of HttpMethod items that start at startIndex in the HttpMethodHeaderValueCollection.

Returns
uint uint uint uint

The number of items retrieved.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

GetView() GetView() GetView() GetView()

Returns an immutable view of the HttpMethodHeaderValueCollection.

public IVectorView<HttpMethod> GetView()public IVectorView<HttpMethod> GetView()Public Function GetView() As IVectorView( Of HttpMethod )public IVectorView<HttpMethod> GetView()
Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IndexOf(HttpMethod, UInt32) IndexOf(HttpMethod, UInt32) IndexOf(HttpMethod, UInt32) IndexOf(HttpMethod, UInt32)

Retrieves the index of an HttpMethod in the collection.

public bool IndexOf(HttpMethod value, UInt32 index)public bool IndexOf(HttpMethod value, UInt32 index)Public Function IndexOf(value As HttpMethod, index As UInt32) As boolpublic bool IndexOf(HttpMethod value, UInt32 index)
Parameters
index
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The index of the HttpMethod in the HttpMethodHeaderValueCollection.

If the item is found, this is the zero-based index of the item; otherwise, this parameter is 0.

Returns
bool bool bool bool

Indicates whether the item is found.

true if the HttpMethod item is found; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

InsertAt(UInt32, HttpMethod) InsertAt(UInt32, HttpMethod) InsertAt(UInt32, HttpMethod) InsertAt(UInt32, HttpMethod)

Inserts an HttpMethod into the collection at the specified index.

public void InsertAt(UInt32 index, HttpMethod value)public void InsertAt(UInt32 index, HttpMethod value)Public Function InsertAt(index As UInt32, value As HttpMethod) As voidpublic void InsertAt(UInt32 index, HttpMethod value)
Parameters
index
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The zero-based index at which value should be inserted.

value
HttpMethod HttpMethod HttpMethod HttpMethod

The object to insert into the collection.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ParseAdd(String) ParseAdd(String) ParseAdd(String) ParseAdd(String)

Parses and adds an entry to the HttpMethodHeaderValueCollection.

public void ParseAdd(String input)public void ParseAdd(String input)Public Function ParseAdd(input As String) As voidpublic void ParseAdd(String input)
Parameters
input
System.String System.String System.String System.String

The entry to add.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)

Removes the entry at the specified index from the HttpMethodHeaderValueCollection.

public void RemoveAt(UInt32 index)public void RemoveAt(UInt32 index)Public Function RemoveAt(index As UInt32) As voidpublic void RemoveAt(UInt32 index)
Parameters
index
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The index of the entry to remove.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

RemoveAtEnd() RemoveAtEnd() RemoveAtEnd() RemoveAtEnd()

Removes the last HttpMethod item from the collection.

public void RemoveAtEnd()public void RemoveAtEnd()Public Function RemoveAtEnd() As voidpublic void RemoveAtEnd()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ReplaceAll(HttpMethod[]) ReplaceAll(HttpMethod[]) ReplaceAll(HttpMethod[]) ReplaceAll(HttpMethod[])

Replaces all the HttpMethod items in the collection with the specified HttpMethod items.

public void ReplaceAll(HttpMethod[] items)public void ReplaceAll(HttpMethod[] items)Public Function ReplaceAll(items As HttpMethod[]) As voidpublic void ReplaceAll(HttpMethod[] items)
Parameters
items
Windows.Web.Http.HttpMethod[] Windows.Web.Http.HttpMethod[] Windows.Web.Http.HttpMethod[] Windows.Web.Http.HttpMethod[]

The HttpMethod items to add to the collection.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

SetAt(UInt32, HttpMethod) SetAt(UInt32, HttpMethod) SetAt(UInt32, HttpMethod) SetAt(UInt32, HttpMethod)

Sets the HttpMethod at the specified index in the collection.

public void SetAt(UInt32 index, HttpMethod value)public void SetAt(UInt32 index, HttpMethod value)Public Function SetAt(index As UInt32, value As HttpMethod) As voidpublic void SetAt(UInt32 index, HttpMethod value)
Parameters
index
System.UInt32 System.UInt32 System.UInt32 System.UInt32

The zero-based index at which to set the HttpMethod.

value
HttpMethod HttpMethod HttpMethod HttpMethod

The item to set.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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

Returns a string that represents the current HttpMethodHeaderValueCollection object.

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

A string that represents the current object.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

TryParseAdd(String) TryParseAdd(String) TryParseAdd(String) TryParseAdd(String)

Tries to parse and add the specified item to the HttpMethodHeaderValueCollection.

public bool TryParseAdd(String input)public bool TryParseAdd(String input)Public Function TryParseAdd(input As String) As boolpublic bool TryParseAdd(String input)
Parameters
input
System.String System.String System.String System.String

The item to parse and add.

Returns
bool bool bool bool

true if the item successfully parsed and was added; otherwise false.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)