HeaderDictionary HeaderDictionary HeaderDictionary Class

Definition

Represents a wrapper for RequestHeaders and ResponseHeaders.

public class HeaderDictionary : Microsoft.AspNetCore.Http.IHeaderDictionary, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,Microsoft.Extensions.Primitives.StringValues>>, System.Collections.Generic.IDictionary<string,Microsoft.Extensions.Primitives.StringValues>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,Microsoft.Extensions.Primitives.StringValues>>
type HeaderDictionary = class
    interface IHeaderDictionary
    interface IDictionary<string, StringValues>
    interface ICollection<KeyValuePair<string, StringValues>>
    interface seq<KeyValuePair<string, StringValues>>
    interface IEnumerable
Public Class HeaderDictionary
Implements ICollection(Of KeyValuePair(Of String, StringValues)), IDictionary(Of String, StringValues), IEnumerable(Of KeyValuePair(Of String, StringValues)), IHeaderDictionary
Inheritance
HeaderDictionaryHeaderDictionaryHeaderDictionary
Implements

Constructors

HeaderDictionary() HeaderDictionary() HeaderDictionary()
HeaderDictionary(Dictionary<String,StringValues>) HeaderDictionary(Dictionary<String,StringValues>) HeaderDictionary(Dictionary<String,StringValues>)
HeaderDictionary(Int32) HeaderDictionary(Int32) HeaderDictionary(Int32)

Properties

ContentLength ContentLength ContentLength
Count Count Count

Gets the number of elements contained in the HeaderDictionary;.

IsReadOnly IsReadOnly IsReadOnly

Gets a value that indicates whether the HeaderDictionary is in read-only mode.

Item[String] Item[String] Item[String]

Get or sets the associated value from the collection as a single string.

Keys Keys Keys
Values Values Values

Methods

Add(KeyValuePair<String,StringValues>) Add(KeyValuePair<String,StringValues>) Add(KeyValuePair<String,StringValues>)

Adds a new list of items to the collection.

Add(String, StringValues) Add(String, StringValues) Add(String, StringValues)

Adds the given header and values to the collection.

Clear() Clear() Clear()

Clears the entire list of objects.

Contains(KeyValuePair<String,StringValues>) Contains(KeyValuePair<String,StringValues>) Contains(KeyValuePair<String,StringValues>)

Returns a value indicating whether the specified object occurs within this collection.

ContainsKey(String) ContainsKey(String) ContainsKey(String)

Determines whether the HeaderDictionary contains a specific key.

CopyTo(KeyValuePair<String,StringValues>[], Int32) CopyTo(KeyValuePair<String,StringValues>[], Int32) CopyTo(KeyValuePair<String,StringValues>[], Int32)

Copies the HeaderDictionary elements to a one-dimensional Array instance at the specified index.

GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through a collection.

Remove(KeyValuePair<String,StringValues>) Remove(KeyValuePair<String,StringValues>) Remove(KeyValuePair<String,StringValues>)

Removes the given item from the the collection.

Remove(String) Remove(String) Remove(String)

Removes the given header from the collection.

TryGetValue(String, StringValues) TryGetValue(String, StringValues) TryGetValue(String, StringValues)

Retrieves a value from the dictionary.

Explicit Interface Implementations

IDictionary<String,StringValues>.Item[String] IDictionary<String,StringValues>.Item[String] IDictionary<String,StringValues>.Item[String]

Throws KeyNotFoundException if the key is not present.

IEnumerable<KeyValuePair<String,StringValues>>.GetEnumerator() IEnumerable<KeyValuePair<String,StringValues>>.GetEnumerator() IEnumerable<KeyValuePair<String,StringValues>>.GetEnumerator()

Returns an enumerator that iterates through a collection.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

Extension Methods

Append(IHeaderDictionary, String, StringValues) Append(IHeaderDictionary, String, StringValues) Append(IHeaderDictionary, String, StringValues)

Add new values. Each item remains a separate array entry.

AppendCommaSeparatedValues(IHeaderDictionary, String, String[]) AppendCommaSeparatedValues(IHeaderDictionary, String, String[]) AppendCommaSeparatedValues(IHeaderDictionary, String, String[])

Quotes any values containing commas, and then comma joins all of the values with any existing values.

GetCommaSeparatedValues(IHeaderDictionary, String) GetCommaSeparatedValues(IHeaderDictionary, String) GetCommaSeparatedValues(IHeaderDictionary, String)

Get the associated values from the collection separated into individual values. Quoted values will not be split, and the quotes will be removed.

SetCommaSeparatedValues(IHeaderDictionary, String, String[]) SetCommaSeparatedValues(IHeaderDictionary, String, String[]) SetCommaSeparatedValues(IHeaderDictionary, String, String[])

Quotes any values containing commas, and then comma joins all of the values.

AppendList<T>(IHeaderDictionary, String, IList<T>) AppendList<T>(IHeaderDictionary, String, IList<T>) AppendList<T>(IHeaderDictionary, String, IList<T>)

Applies to