Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class Microsoft.​AspNetCore.​Http.​HeaderDictionaryExtensions

Assembly: Microsoft.AspNetCore.Http.Abstractions

Inheritance: object → HeaderDictionaryExtensions

Contains extension methods for modifying an <see cref="T:Microsoft.AspNetCore.Http.IHeaderDictionary" /> instance.

Methods

public static void
Append​(IHeaderDictionary headers, string key, Extensions.​Primitives.​StringValues value)
Add new values. Each item remains a separate array entry.
headers The <see cref="T:Microsoft.AspNetCore.Http.IHeaderDictionary" /> to use.
key The header name.
value The header value.
public static void
AppendCommaSeparatedValues​(IHeaderDictionary headers, string key, string[] values)
Quotes any values containing commas, and then comma joins all of the values with any existing values.
headers The <see cref="T:Microsoft.AspNetCore.Http.IHeaderDictionary" /> to use.
key The header name.
values The header values.
public static string[]
GetCommaSeparatedValues​(IHeaderDictionary headers, string key)
Get the associated values from the collection separated into individual values. Quoted values will not be split, and the quotes will be removed.
Returns the associated values from the collection separated into individual values, or StringValues.Empty if the key is not present.
headers The <see cref="T:Microsoft.AspNetCore.Http.IHeaderDictionary" /> to use.
key The header name.
public static void
SetCommaSeparatedValues​(IHeaderDictionary headers, string key, string[] values)
Quotes any values containing commas, and then comma joins all of the values.
headers The <see cref="T:Microsoft.AspNetCore.Http.IHeaderDictionary" /> to use.
key The header name.
values The header values.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object