HttpClientImpl class final
Class that implements HttpClient using dio.Dio
.
- Implemented types
Constructors
-
HttpClientImpl(String baseUrl, {AuthorizationOptions? authorization, List<
Interceptor> ? interceptors, PinningOptions? pinning, RefreshOptions? refresh, RetryOptions? retry, bool showLogs = false, TimeoutOptions timeout = const TimeoutOptions()})
Properties
-
Options for adding the authorization tokens on the requests.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
interceptors
→ List<
Interceptor> ? -
List of interceptors to be added to the
dio.Dio
instance.final - pinning → PinningOptions?
-
Options for pinning the requests with SSL Certificates.
final
- refresh → RefreshOptions?
-
Options for refreshing the authentication tokens.
final
- retry → RetryOptions?
-
Options for retrying a failed request.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showLogs → bool
-
Flag that indicates if the logs should be shown.
final
Methods
-
addCertificates(
) → void -
Add certificates to the
dio.Dio
instance. -
addInterceptors(
) → void -
Add interceptors to the
dio.Dio
instance. -
delete<
T> (String endpoint, {bool authenticate = false, Object? body, Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, String? replaceBaseUrl, String? segment, bool? showLogs, String? step}) → Future<HttpResponse< T> > -
Method that represents the HTTP's DELETE method.
override
-
download(
String endpoint, String pathToSave, {bool authenticate = false, Object? body, Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, String? replaceBaseUrl, String? segment, bool? showLogs, String? step}) → Future<HttpResponse> -
Method that represents the HTTP's GET method to download a file.
override
-
get<
T> (String endpoint, {bool authenticate = false, Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, String? replaceBaseUrl, String? segment, bool? showLogs, String? step}) → Future<HttpResponse< T> > -
Method that represents the HTTP's GET method.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch<
T> (String endpoint, {bool authenticate = false, Object? body, Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, String? replaceBaseUrl, String? segment, bool? showLogs, String? step}) → Future<HttpResponse< T> > -
Method that represents the HTTP's PATCH method.
override
-
post<
T> (String endpoint, {bool authenticate = false, Object? body, Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, String? replaceBaseUrl, String? segment, bool? showLogs, String? step}) → Future<HttpResponse< T> > -
Method that represents the HTTP's POST method.
override
-
put<
T> (String endpoint, {bool authenticate = false, Object? body, Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, String? replaceBaseUrl, String? segment, bool? showLogs, String? step}) → Future<HttpResponse< T> > -
Method that represents the HTTP's PUT method.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited