Clone this repo:
  1. c140142 Migrate to GitHub Actions (#16) by Alexander Thomas · 5 weeks ago master
  2. 957090e CI: use Chrome over firefox (#15) by Kevin Moore · 6 months ago
  3. a021aa5 Increase description length to be >= 60 characters by Kevin Moore · 1 year ago
  4. 695d8bd Add an example and fix example in readme by Kevin Moore · 1 year ago
  5. eb13288 Remove pubspec author and outdated URLs by Kevin Moore · 1 year ago

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 {
  } finally {

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.