APIModuleProxyHttpCaller<T> class

An APIModuleProxy caller that performs HTTP requests. Implements a ClassProxyListener that redirects calls to httpClient.

Inheritance

Constructors

APIModuleProxyHttpCaller(HttpClient httpClient, {String? moduleRoute, bool? responsesAsJson, APIModuleProxyResponseErrorHandler? errorHandler})

Properties

errorHandler APIModuleProxyResponseErrorHandler?
The error handler to call when an HTTP response error happens.
final
hashCode int
The hash code for this object.
no setterinherited
httpClient → HttpClient
The httpClient ot perform the proxy calls.
final
modulePath String
The module path in the httpClient base URL.
final
requestHandler APIModuleHttpProxyRequestHandler?
getter/setter pair
responsesAsJson bool
If true all the returned responses of httpClient requests will be decoded as JSON. If false will treat as response only of Content-Type is JSON or JavaScript (HttpResponse.isBodyTypeJSON).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decodeJson(String content) → dynamic
doRequest(String methodName, Map<String, Object?> parameters, TypeReflection? returnType) Future
isByteArrayResponse(HttpResponse response, MimeType? mimeType) bool
isJsonResponse(HttpResponse response, MimeType? mimeType) bool
isTextResponse(HttpResponse response, MimeType? mimeType) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCall(dynamic instance, String methodName, Map<String, Object?> parameters, TypeReflection? returnType) Future
Calls made through a ClassProxy will be intercepted by onCall implementation.
override
parseResponse(HttpResponse response, {HttpMethod? requestMethod, String? requestPath, String? methodName, Map<String, Object?>? parameters}) → dynamic
parseResponseBody(HttpResponse response) Object?
resolveResponse(TypeReflection? returnType, dynamic json) Object?
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

defaultErrorHandler APIModuleProxyResponseErrorHandler?
The default response error handler. See errorHandler.
getter/setter pair