HttpAdapter class interface
An adapter that HttpFetcher
instances uses to call http.Client
.
This interface can be overridden to implement more sophisticated logic when calling HTTP, like error management, fault-tolerance, re-try mechanism, handling forward status codes, caching etc.
Constructors
- HttpAdapter.client(Client client)
-
A HTTP adapter using the given HTTP
client
.const - HttpAdapter.simple()
-
A simple HTTP adapter that creates a new
http.Client
for each request.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
get(
Uri uri, {Map< String, String> ? headers}) → Future<Response> -
Makes an HTTP GET request to a resource identified by
uri
. -
getStreamed(
Uri uri, {Map< String, String> ? headers}) → Future<StreamedResponse> -
Makes an HTTP GET streamed request to a resource identified by
uri
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited