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({required List<MiddlewareContract?> middlewares})
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
middlewares List<MiddlewareContract>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post(dynamic url, {Map<String, String>? headers, required dynamic body, Encoding? encoding}) Future<Response>
readBytes(dynamic 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