CharlatanHttpClientAdapter class

An implementation of dio's HttpClientAdapter that returns fake HTTP responses based on the configuration of a Charlatan instance.

final charlatan = Charlatan();
Dio()..httpClientAdapter = CharlatanHttpClientAdapter(charlatan);

Constructors

CharlatanHttpClientAdapter(Charlatan charlatan)
An implementation of dio's HttpClientAdapter that returns fake HTTP responses based on the configuration of a Charlatan instance.
const

Properties

charlatan Charlatan
Fake HTTP definitions for this adapter
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fetch(RequestOptions options, Stream<Uint8List>? requestStream, Future? cancelFuture) Future<ResponseBody>
Returns a ResponseBody matching the request if one exists in charlatan. If no response matches, throws UnimplementedError.
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