AppHttpClientBase class

Dio HTTP Wrapper with convenient, predictable exception handling.

Implementers

Constructors

AppHttpClientBase({required Dio dio, ResponseExceptionMapper? exceptionMapper})
Create a new App HTTP Client with the specified Dio instance dio and an optional exceptionMapper.

Properties

dio Dio
final
exceptionMapper ResponseExceptionMapper?
If provided, this function which will be invoked when a response exception occurs, allowing the response exception to be mapped to a custom exception class which extends AppHttpClientException.
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

get<T>(String path, {Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, ProgressCallback? onReceiveProgress}) Future<Response<T>>
HTTP GET request.
gql<T>(String method, dynamic query, {String? path, Map<String, dynamic>? variables, Options? options, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post<T>(String path, {dynamic data, Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
HTTP POST request.
request<T>(String method, String path, {dynamic data, Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) Future<Response<T>>
toString() String
A string representation of this object.
inherited

Operators

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