HeaderDictionary Třída

Definice

Představuje obálku pro RequestHeaders a ResponseHeaders.

public ref class HeaderDictionary : Microsoft::AspNetCore::Http::IHeaderDictionary, System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::String ^, Microsoft::Extensions::Primitives::StringValues>>, System::Collections::Generic::IDictionary<System::String ^, Microsoft::Extensions::Primitives::StringValues>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, Microsoft::Extensions::Primitives::StringValues>>
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
type HeaderDictionary = class
    interface IHeaderDictionary
    interface ICollection<KeyValuePair<string, StringValues>>
    interface seq<KeyValuePair<string, StringValues>>
    interface IEnumerable
    interface IDictionary<string, StringValues>
Public Class HeaderDictionary
Implements ICollection(Of KeyValuePair(Of String, StringValues)), IDictionary(Of String, StringValues), IEnumerable(Of KeyValuePair(Of String, StringValues)), IHeaderDictionary
Dědičnost
HeaderDictionary
Implementuje

Konstruktory

HeaderDictionary()

Inicializuje novou instanci .HeaderDictionary

HeaderDictionary(Dictionary<String,StringValues>)

Inicializuje novou instanci .HeaderDictionary

HeaderDictionary(Int32)

Inicializuje novou instanci .HeaderDictionary

Vlastnosti

ContentLength

Silně zadaný přístup k hlavičce Content-Length. Implementace musí být synchronizované s řetězcovou reprezentací.

Count

Získá počet prvků obsažených v souboru HeaderDictionary;.

IsReadOnly

Získá hodnotu, která označuje, zda HeaderDictionary je v režimu jen pro čtení.

Item[String]

Získá nebo nastaví přidruženou hodnotu z kolekce jako jeden řetězec.

Keys

Získá kolekci názvů hlaviček HTTP v této instanci.

Values

Získá kolekci hodnot hlaviček HTTP v této instanci.

Metody

Add(KeyValuePair<String,StringValues>)

Přidá do kolekce novou položku záhlaví.

Add(String, StringValues)

Přidá dané záhlaví a hodnoty do kolekce.

Clear()

Vymaže celý seznam objektů.

Contains(KeyValuePair<String,StringValues>)

Vrátí hodnotu označující, jestli se zadaný objekt vyskytuje v této kolekci.

ContainsKey(String)

Určuje, zda HeaderDictionary obsahuje konkrétní klíč.

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

HeaderDictionary Zkopíruje prvky do jednorozměrné instance pole v zadaném indexu.

GetEnumerator()

Vrací enumerátor procházející kolekci.

Remove(KeyValuePair<String,StringValues>)

Odebere danou položku z kolekce.

Remove(String)

Odebere dané záhlaví z kolekce.

TryGetValue(String, StringValues)

Načte hodnotu ze slovníku.

Explicitní implementace rozhraní

IDictionary<String,StringValues>.Item[String]

Vyvolá KeyNotFoundException, pokud klíč není k dispozici.

IEnumerable.GetEnumerator()

Vrací enumerátor procházející kolekci.

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

Vrací enumerátor procházející kolekci.

Metody rozšíření

Append(IHeaderDictionary, String, StringValues)

Přidejte nové hodnoty. Každá položka zůstává samostatnou položkou pole.

AppendCommaSeparatedValues(IHeaderDictionary, String, String[])

Uvozovky všechny hodnoty obsahující čárky a poté čárky spojí všechny hodnoty s libovolnými existujícími hodnotami.

GetCommaSeparatedValues(IHeaderDictionary, String)

Získejte přidružené hodnoty z kolekce oddělené do jednotlivých hodnot. Hodnoty uvozovek nebudou rozděleny a uvozovky budou odebrány.

SetCommaSeparatedValues(IHeaderDictionary, String, String[])

Uvozovky všechny hodnoty obsahující čárky a pak čárky spojí všechny hodnoty.

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

Připojí sekvenci hodnot k IHeaderDictionary.

Platí pro