HeadersMapperLink class
This ApiLink takes headers specified by headersToMap
argument
from response headers and then put to the next request headers.
It can be used for authorization. For example,we have an authorization
header that changes after each request and with the next query we
must send it back in headers. This ApiLink will take it from the
response, save and set as a next request header.
Constructors
-
HeadersMapperLink(List<
String> headersTopMap, {bool debug = false}) -
Construct ApiLink that takes headers specified by
headersToMap
argument from response headers and then put to the next request headers.
Properties
- attached → bool
-
no setterinherited
- chained → bool
-
no setterinherited
- disposed → bool
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
Get currently saved headers
no setter
- isReleaseBuild → bool
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
chain(
ApiLink nextLink) → ApiLink -
Chain multiple links into one.
throws ApiError when error occurs
inherited
-
clear(
) → void - Removes all saved headers
-
dispose(
) → void -
Called when API object has been disposed
inherited
-
next(
Request request) → Future< Response> -
This method is called on every request.
Calling
super.next
will cause invocation ofnext
method in the next ApiLink in the chain (if present)override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setHeaders(
Map< String, String> headers) → void - Saves headers for later use
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited