Docs · API reference · Motus.Abstractions

IHeaderCollection Interface#

Represents a read-only collection of HTTP headers.

public interface IHeaderCollection : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, System.Collections.Generic.IReadOnlyList<string>>>, System.Collections.IEnumerable

Implements System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Collections.Generic.IReadOnlyList<System.String>>>, System.Collections.IEnumerable

Properties#

this[string] Property#

Gets the value of the header with the specified name.

string this[string name] { get; }

Parameters#

name System.String

The header name (case-insensitive).

Property Value#

System.String

Methods#

Contains(string) Method#

Returns whether the collection contains a header with the specified name.

bool Contains(string name);

Parameters#

name System.String

The header name (case-insensitive).

Returns#

System.Boolean
True if the header is present.

GetAll(string) Method#

Gets all values for the header with the specified name.

System.Collections.Generic.IReadOnlyList<string> GetAll(string name);

Parameters#

name System.String

The header name (case-insensitive).

Returns#

System.Collections.Generic.IReadOnlyList<System.String>
A list of all values for the header.