Headers class
Properties
Methods
-
add(
String name, String value) → void -
Adds a header value. The header named
name
will have the valuevalue
added to its list of values. -
clear(
) → void -
forEach(
HeaderForEachCallback f) → void -
Enumerates the headers, applying the function
f
to each header. The header name passed inname
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 valuevalue
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
Constants
- acceptHeader → const String
-
'accept'
- contentEncodingHeader → const String
-
'content-encoding'
- contentLengthHeader → const String
-
'content-length'
- contentTypeHeader → const String
-
'content-type'
- formUrlEncodedContentType → const String
-
'application/x-www-form-urlencoded;charset=utf-8'
- jsonContentType → const String
-
'application/json; charset=utf-8'
- textPlainContentType → const String
-
'text/plain'
- wwwAuthenticateHeader → const String
-
'www-authenticate'