mercury_client library
Library Mercury_Client
Classes
- Authorization
- Represents a kind of HTTP Authorization.
- BasicCredential
-
A HTTP Basic Credential for the
Authorization
header. - BearerCredential
-
A HTTP Bearer Credential for the
Authorization
header. - Credential
- Abstract Credential for HttpRequest.
-
HttpBlob<
B> - HttpBody
- A wrapper for multiple types of data body.
- HttpCache
- A cache for HttpClient. Request originated from this cache are stored in memory.
-
HttpCall<
R> - Represents a simple HTTP call that can be called many times.
- HttpClient
- Mercury HTTP Client.
- HttpClientInterceptor
- An interceptor that can be used to filter requests and responses.
- HttpClientRequester
- Abstract HttpClient requester. This should implement the actual request process.
- HttpClientRequesterSimulation
- A Simulated HttpClientRequester. Useful for tests and mocks.
- HttpError
- Represents a response Error.
- HttpRequest
- Represents the HTTP request.
- HttpRequestBody
- Represents a body content, used by HttpRequest.
- HttpRequester
- A Class able to do a HTTP request based in properties:
- HttpResponse
- The response of a HttpRequest.
- HttpStatus
- Represents a HTTP Status with helpers. Base for HttpResponse and HttpError.
- JSONBodyCredential
- A Credential that injects a JSON in the HttpRequest body.
- QueryStringCredential
- A Credential that injects fields in the Query parameters.
Enums
- HttpMethod
- HTTP Method
Functions
-
buildURLWithQueryParameters(
String url, Map< String, String?> parameters, {bool removeFragment = false}) → String -
Builds an URL with Query parameters adding the map
parameters
to current Query parameters. -
canHttpMethodHaveBody(
HttpMethod method) → bool -
contentTypeToDecoder(
MimeType mimeType) → Converter< List< int> , String> -
Returns de decoder for a Content-Type at parameter
mimeType
andcharset
. -
createHttpBlob(
List content, MimeType? mimeType) → HttpBlob? -
createHttpClientRequester(
) → HttpClientRequester - Creates a HttpClientRequester based in imported platform.
-
getHttpClientRuntimeUri(
) → Uri - Returns the base runtime Uri for the platform.
-
getHttpMethod(
String? method, [HttpMethod? def]) → HttpMethod? -
Returns HttpMethod instance for
method
parameter. -
getHttpMethodName(
HttpMethod? method, [HttpMethod? def]) → String? -
Returns
method
name. -
isHttpBlob(
Object o) → bool -
methodAcceptsQueryString(
HttpMethod method) → bool
Typedefs
- AuthorizationInterceptor = void Function(Authorization? authorization)
-
AuthorizationProvider
= Future<
Credential?> Function(HttpClient client, HttpError? lastError) -
HttpBodyBuilder
= dynamic Function(Map<
String, String?> parameters) - Function to dynamically build a HTTP body.
-
HttpBodyBuilderTyped
= dynamic Function(Map<
String, String?> parameters, String? type) -
HttpClientURLFilter
= String Function(String url, Map<
String, String?> ? queryParameters) - OnCachedResponse = void Function(HttpResponse cachedResponse)
- ProgressListener = void Function(HttpRequest request, int? loaded, int? total, double? ratio, bool upload)
-
RequestHeadersBuilder
= Map<
String, String> Function(HttpClient client, String url) - ResponseHeaderGetter = String? Function(String headerKey)
- ResponseProcessor = void Function(HttpClient client, Object request, HttpResponse response)
-
SimulateResponse
= dynamic Function(String url, Map<
String, String?> ? queryParameters)