charlatan library

Classes

Charlatan
A class for building a collection of fake http responses to power a fake http client.
CharlatanHttpClientAdapter
An implementation of dio's HttpClientAdapter that returns fake HTTP responses based on the configuration of a Charlatan instance.
CharlatanHttpRequest
A type representing a HTTP request.
CharlatanHttpResponse
A type representing a HTTP response.

Extensions

CharlatanExtensions on Charlatan
Utilities to make it easier to work with Charlatan.

Functions

charlatanResponse({int statusCode = 200, Object? body, Map<String, String> headers = const {}}) → CharlatanResponseBuilder
A function to build a CharlatanResponseBuilder. The statusCode defaults to 200, the body defaults to null, and the headers defaults to empty.
requestMatchesAll(List<CharlatanRequestMatcher> matchers) CharlatanRequestMatcher
A function to build a CharlatanRequestMatcher that matches if all of the provided CharlatanRequestMatchers match.
requestMatchesHttpMethod(String method) CharlatanRequestMatcher
A function to build a CharlatanRequestMatcher that matches if the http method of the request matches the provided method.
requestMatchesPathOrTemplate(String pathOrTemplate) CharlatanRequestMatcher
A function to build a CharlatanRequestMatcher that matches if the request path matches the provided pathOrTemplate.

Typedefs

CharlatanRequestMatcher = bool Function(CharlatanHttpRequest request)
A type representing a function to detect if an http request matches a predicate.