HttpClient class

Implementers

Constructors

HttpClient({required String apiUrl, required bool enableLogs, required bool preventLargeResponses, Duration? connectTimeout = const Duration(seconds: 5), int maxAttempts = 3, bool kIsWeb = false})

Properties

apiUrl String
final
connectTimeout Duration?
final
enableLogs bool
final
hashCode int
The hash code for this object.
no setterinherited
kIsWeb bool
final
maxAttempts int
final
preventLargeResponses bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkInternetConnection(List<Uri> urls) Future<bool>
fetch({required String path, Map<String, dynamic>? params, Map<String, dynamic>? headers, int? maxAttempts, Cache? enableCache}) Future<HttpResponse>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
request({required String path, required HttpMethod method, Object? data, Map<String, dynamic>? params, Map<String, dynamic>? headers, int? maxAttempts, Duration? timeout}) Future<HttpResponse>
setHeader(String key, String? value) bool
setHeaders(Map<String, String> map) bool
toString() String
A string representation of this object.
inherited

Operators

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