RetryClient class
A client that automatically retries failed requests.
Constructors
- RetryClient(HTTPSClient _client, {int maxRetries = 3, Duration initialDelay = const Duration(milliseconds: 500), double delayMultiplier = 1.5})
- Creates a retry client.
Properties
- 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(
Object url, {Map< String, String> ? headers}) → Future<Response> -
Makes a DELETE request with automatic retries.
The
urlcan be either a String or a Uri object. -
download(
Object url, String fileName, {Map< String, String> ? headers, void onProgress(int bytesReceived, int totalBytes)?}) → Future<String> -
Downloads a file from the specified
urlto a temporary location with automatic retries. Theurlcan be either a String or a Uri object. -
get(
Object url, {Map< String, String> ? headers}) → Future<Response> -
Makes a GET request with automatic retries.
The
urlcan be either a String or a Uri object. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch(
Object url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> -
Makes a PATCH request with automatic retries.
The
urlcan be either a String or a Uri object. -
post(
Object url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> -
Makes a POST request with automatic retries.
The
urlcan be either a String or a Uri object. -
put(
Object url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> -
Makes a PUT request with automatic retries.
The
urlcan be either a String or a Uri object. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited