DynCallHttpClient class

A HTTP Client for DynCallHttpExecutor calls.

Inheritance

Constructors

DynCallHttpClient(String baseURL, [HttpClientRequester? clientRequester])

Properties

authorization ↔ Authorization?
The Authorization (that resolves Credential) for requests.
getter/setter pairinherited
authorizationResolutionInterceptor ↔ AuthorizationInterceptor?
getter/setter pairinherited
baseURL ↔ String
The base URL for the client requests.
getter/setter pairinherited
clientRequester → HttpClientRequester
Returns the HttpClientRequester instance.
no setterinherited
crossSiteWithCredentials ↔ bool?
If set to true, sends credential to cross sites.
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
hasInterceptor → bool
Returns true if has an interceptor.
no setterinherited
id → int
ID of this client.
finalinherited
interceptor ↔ HttpClientInterceptor?
An optional interceptor, that can be used to log requests or to change headers and URLs.
getter/setter pairinherited
isAuthorizationResolved → bool
Returns true if authorization is resolved.
no setterinherited
jsonDecoder ↔ dynamic Function(String jsonEncoded)?
The JSON decoder. Default: dart:convert json
getter/setter pairinherited
logJSON ↔ bool
getter/setter pairinherited
logRequests ↔ bool
getter/setter pairinherited
requestHeadersBuilder ↔ RequestHeadersBuilder?
Builds initial headers for each request.
getter/setter pairinherited
resolvedAuthorization → Authorization?
Returns the authorization if is resolved.
no setterinherited
responseHeaderWithToken → String?
The response header with a token to use as authorization Credential.
no setterinherited
responseProcessor ↔ ResponseProcessor?
Function that processes any request response.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
urlFilter ↔ HttpClientURLFilter?
The URL filter, if present.
getter/setter pairinherited
userAgent ↔ String?
getter/setter pairinherited

Methods

autoChangeAuthorizationToBearerToken(String responseHeaderWithToken) → HttpClient
If set, will automatically use a token in the header responseHeaderWithToken, when found in any request.
inherited
buildMethodRequestURL(HttpMethod method, String? path, bool fullPath, Map<String, String?>? parameters) → String
Builds the URL for method using path or fullPath.
inherited
buildRequestHeaders(String url) → Map<String, String>?
inherited
buildRequestURL(HttpMethod method, String path, {bool fullPath = false, Authorization? authorization, Map<String, Object?>? parameters, String? queryString, bool noQueryString = false}) → String
Builds a Request URL, with the same rules of requestURL.
inherited
buildURL(String path, bool fullPath, [Map<String, String?>? queryParameters, bool allowURLQueryString = true]) → String
Builds a URL, using baseURL with path or fullPath.
inherited
delete(String path, {Map<String, String>? headers, bool fullPath = false, Credential? authorization, Map<String, String?>? parameters, String? queryString, Object? body, String? contentType, String? accept, String? responseType, ProgressListener? progressListener}) → Future<HttpResponse>
Does a DELETE request.
inherited
executor<E>(HttpMethod method, String path, {Map<String, String>? parametersMap, String? queryString, List<String>? authorizationFields, E? errorResponse, int errorMaxRetries = 3}) → DynCallHttpExecutor<E>
get(String path, {Map<String, String>? headers, bool fullPath = false, Credential? authorization, Map<String, Object?>? parameters, String? accept, String? responseType, ProgressListener? progressListener}) → Future<HttpResponse>
/////////// Does a GET request.
inherited
getJSON(String path, {Map<String, String>? headers, Credential? authorization, Map<String, Object?>? parameters}) → Future
Does a GET request and returns a decoded JSON.
inherited
Does a HEAD request.
inherited
isBaseUrlLocalhost() → bool
Returns true if this baseURL is localhost.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
options(String path, {Map<String, String>? headers, bool fullPath = false, Credential? authorization, Map<String, Object?>? parameters, ProgressListener? progressListener}) → Future<HttpResponse>
Does an OPTIONS request.
inherited
optionsJSON(String path, {Map<String, String>? headers, Credential? authorization, Map<String, Object?>? parameters}) → Future
Does an OPTION request and returns a decoded JSON.
inherited
patch(String path, {Map<String, String>? headers, bool fullPath = false, Credential? authorization, Map<String, Object?>? parameters, String? queryString, Object? body, String? contentType, String? accept, String? responseType, ProgressListener? progressListener}) → Future<HttpResponse>
Does a PATCH request.
inherited
post(String path, {Map<String, String>? headers, bool fullPath = false, Credential? authorization, Map<String, Object?>? parameters, String? queryString, Object? body, String? contentType, String? accept, String? responseType, ProgressListener? progressListener}) → Future<HttpResponse>
Does a POST request.
inherited
postJSON(String path, {Map<String, String>? headers, Credential? authorization, Map<String, Object?>? parameters, Object? body, String? contentType}) → Future
Does a POST request and returns a decoded JSON.
inherited
put(String path, {Map<String, String>? headers, bool fullPath = false, Credential? authorization, Map<String, Object?>? parameters, String? queryString, Object? body, String? contentType, String? accept, String? responseType, ProgressListener? progressListener}) → Future<HttpResponse>
Does a PUT request.
inherited
putJSON(String path, {Map<String, String>? headers, Credential? authorization, Object? body, String? contentType}) → Future
Does a PUT request and returns a decoded JSON.
inherited
request(HttpMethod method, String path, {bool fullPath = false, Map<String, String>? headers, Credential? authorization, Map<String, Object?>? parameters, String? queryString, Object? body, String? contentType, String? accept, bool noQueryString = false, ProgressListener? progressListener}) → Future<HttpResponse>
Does a request using method.
inherited
requestJSON(HttpMethod method, String path, {Map<String, String>? headers, Credential? authorization, Map<String, Object?>? queryParameters, Object? body, String? contentType, String? accept}) → Future
Requests using method and path and returns a decoded JSON.
inherited
requestURL(HttpMethod method, String url, {Map<String, String>? headers, Credential? authorization, Map<String, Object?>? queryParameters, dynamic noQueryString = false, Object? body, String? contentType, String? accept, ProgressListener? progressListener}) → Future<HttpResponse>
inherited
toString() → String
A string representation of this object.
inherited
withBasePath(String basePath) → HttpClient
Returns a new HttpClient instance using basePath as path of baseURL.
inherited
withBaseURL(String baseURL, {bool preserveAuthorization = false}) → HttpClient
Returns a new HttpClient instance using baseURL.
inherited

Operators

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