InterceptedHttp class

Class to be used by the user as a replacement for 'http' with interceptor supported. call the build() constructor passing in the list of interceptors. Example:

InterceptedHttp http = InterceptedHttp.build(interceptors: [
    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

InterceptedHttp.build({required List<InterceptorContract> interceptors, Duration? requestTimeout, RetryPolicy? retryPolicy, String findProxy(Uri)?, Client? client})
factory

Properties

client ↔ Client?
getter/setter pair
findProxy ↔ (String Function(Uri)?)
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
interceptors List<InterceptorContract>
getter/setter pair
requestTimeout Duration?
getter/setter pair
retryPolicy RetryPolicy?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(dynamic url, {Map<String, String>? headers, Map<String, dynamic>? params, Object? body, Encoding? encoding}) Future<Response>
get(dynamic url, {Map<String, String>? headers, Map<String, dynamic>? params}) Future<Response>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch(dynamic url, {Map<String, String>? headers, Map<String, dynamic>? params, Object? body, Encoding? encoding}) Future<Response>
post(dynamic url, {Map<String, String>? headers, Map<String, dynamic>? params, Object? body, Encoding? encoding}) Future<Response>
put(dynamic url, {Map<String, String>? headers, Map<String, dynamic>? params, Object? body, Encoding? encoding}) Future<Response>
read(dynamic url, {Map<String, String>? headers, Map<String, dynamic>? params}) Future<String>
readBytes(dynamic url, {Map<String, String>? headers, Map<String, dynamic>? params}) Future<Uint8List>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited