Headers class

The headers class for requests and responses.

Constructors

Headers({bool preserveHeaderCase = false})
Headers.fromMap(Map<String, List<String>> map, {bool preserveHeaderCase = false})
Create the Headers from a Map instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Whether the headers has no fields.
no setter
map Map<String, List<String>>
no setter
preserveHeaderCase bool
Whether the header key should be case-sensitive.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(String name, String value) → void
Adds a header value. The header named name will have the value value added to its list of values.
clear() → void
Clearing all fields in the headers.
forEach(HeaderForEachCallback f) → void
Enumerates the headers, applying the function f to each header. The header name passed in name will be all lower case.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String name, String value) → void
Removes a specific value for a header name.
removeAll(String name) → void
Removes all values for the specified header name.
set(String name, dynamic value) → void
Sets a header. The header named name will have all its values cleared before the value value is added as its value.
toString() String
A string representation of this object.
override
value(String name) String?
Convenience method for the value for a single valued header. If there is no header with the provided name, null will be returned. If the header has more than one value an exception is thrown.

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String name) List<String>?
Returns the list of values for the header named name. If there is no header with the provided name, null will be returned.

Static Properties

jsonMimeType → MediaType
final