commit | 7b505c8eeaf8c3818a5bb1862ae67625a8c6f1f7 | [log] [tgz] |
---|---|---|
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | Sat Jun 05 13:40:25 2021 -0700 |
committer | GitHub <noreply@github.com> | Sat Jun 05 13:40:25 2021 -0700 |
tree | 48e313b41c1e11f3e7433eb154440556d4fcb475 | |
parent | fdf3a9cc6c766b7aecfc0d1b246cddaeee250160 [diff] |
Bump dart-lang/setup-dart from 0.3 to 1 (#20) Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 0.3 to 1. - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](https://github.com/dart-lang/setup-dart/compare/v0.3...v1) --- updated-dependencies: - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
Middleware for the http
package that transparently retries failing requests.
To use this, just create an RetryClient
that wraps the underlying http.Client
:
import 'package:http/http.dart' as http; import 'package:http_retry/http_retry.dart'; Future<void> main() async { final client = RetryClient(http.Client()); try { print(await client.read('http://example.org')); } finally { client.close(); } }
By default, this retries any request whose response has status code 503 Temporary Failure up to three retries. It waits 500ms before the first retry, and increases the delay by 1.5x each time. All of this can be customized using the RetryClient()
constructor.