HttpWithMiddleware class
Class to be used by the user as a replacement for 'http' with middleware supported.
call the build()
constructor passing in the list of middlewares.
Example:
HttpWithMiddleware http = HttpWithMiddleware.build(middlewares: [
Logger(),
]);
Then call the functions you want to, on the created http
object.
http.get(...);
http.post(...);
http.put(...);
http.delete(...);
http.head(...);
http.patch(...);
http.read(...);
http.readBytes(...);
Constructors
-
HttpWithMiddleware.build({List<
MiddlewareContract> ? middlewares, Duration? requestTimeout}) -
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
middlewares
↔ List<
MiddlewareContract> ? -
getter/setter pair
- requestTimeout ↔ Duration?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
Uri url, {Map< String, String> ? headers, dynamic body, Encoding? encoding}) → Future<Response> -
get(
Uri url, {Map< String, String> ? headers}) → Future<Response> -
head(
Uri url, {Map< String, String> ? headers}) → Future<Response> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch(
Uri url, {Map< String, String> ? headers, dynamic body, Encoding? encoding}) → Future<Response> -
post(
Uri url, {Map< String, String> ? headers, dynamic body, Encoding? encoding}) → Future<Response> -
put(
Uri url, {Map< String, String> ? headers, dynamic body, Encoding? encoding}) → Future<Response> -
read(
Uri url, {Map< String, String> ? headers}) → Future<String> -
readBytes(
Uri url, {Map< String, String> ? headers}) → Future<Uint8List> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited