Headers class abstract interface

Headers and Trailers for HTTP requests and responses.

Names are always in lowercase.

Available extensions

Constructors

Headers()
Creates an empty Headers instance.
factory
Headers.from(Headers other)
Creates a new Headers instance copying all the headers from other.
factory

Properties

entries → Iterable<({String name, String value})>
Name value pairs of headers.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(String name, String value) → void
Adds a value to the header with name
addAll(Headers other) → void

Available on Headers, provided by the HeadersExtension extension

Copies all values from other
contains(String name) → bool

Available on Headers, provided by the HeadersExtension extension

Whether named header is in the Headers.
get(String name) → Iterable<String>?
Gets the values of a header.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String name) → void
Removes the header matching name.
set(String name, Iterable<String> values) → void
Sets a header.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited
operator [](String name) → String?

Available on Headers, provided by the HeadersExtension extension

Gets the first value of the header with name.
operator []=(String name, String value) → void

Available on Headers, provided by the HeadersExtension extension

Sets the header name to value.