DioService class abstract

Thin, testable contract for network operations supported by DioService.

Prefer depending on this abstraction in your code to simplify mocking and facilitate swapping implementations if needed.

Constructors

DioService()

Properties

baseUrl String
Base URL used to resolve relative request paths.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete<T>(String path, {dynamic data, Map<String, dynamic>? query, Map<String, String>? headers}) Future<ApiResult<T>>
Sends an HTTP DELETE request to path.
get<T>(String path, {Map<String, dynamic>? query, Map<String, String>? headers}) Future<ApiResult<T>>
Sends an HTTP GET request to path.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch<T>(String path, {dynamic data, Map<String, dynamic>? query, Map<String, String>? headers}) Future<ApiResult<T>>
Sends an HTTP PATCH request to path.
post<T>(String path, {dynamic data, Map<String, dynamic>? query, Map<String, String>? headers}) Future<ApiResult<T>>
Sends an HTTP POST request to path.
put<T>(String path, {dynamic data, Map<String, dynamic>? query, Map<String, String>? headers}) Future<ApiResult<T>>
Sends an HTTP PUT request to path.
toString() String
A string representation of this object.
inherited

Operators

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