File tree Expand file tree Collapse file tree 5 files changed +26
-7
lines changed Expand file tree Collapse file tree 5 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 1
1
language : dart
2
2
3
3
dart :
4
- - 2.0 .0
4
+ - 2.1 .0
5
5
- dev
6
6
7
7
dart_task :
Original file line number Diff line number Diff line change 1
1
## 0.1.2
2
2
3
3
* Fix a number of lints affecting package maintenance score.
4
+ * Update minimum Dart SDK to ` 2.1.0 ` .
4
5
5
6
## 0.1.1+3
6
7
Original file line number Diff line number Diff line change @@ -11,16 +11,19 @@ underlying [`http.Client`][Client]:
11
11
import 'package:http/http.dart' as http;
12
12
import 'package:http_retry/http_retry.dart';
13
13
14
- main() async {
15
- var client = new RetryClient(new http.Client());
16
- print(await client.read("http://example.org"));
17
- await client.close();
14
+ Future<void> main() async {
15
+ final client = RetryClient(http.Client());
16
+ try {
17
+ print(await client.read('http://example.org'));
18
+ } finally {
19
+ client.close();
20
+ }
18
21
}
19
22
```
20
23
21
24
By default, this retries any request whose response has status code 503
22
25
Temporary Failure up to three retries. It waits 500ms before the first retry,
23
26
and increases the delay by 1.5x each time. All of this can be customized using
24
- the [ ` new RetryClient()` ] [ new RetryClient ] constructor.
27
+ the [ ` RetryClient() ` ] [ new RetryClient ] constructor.
25
28
26
29
[ new RetryClient ] : https://pub.dev/documentation/http_retry/latest/http_retry/RetryClient/RetryClient.html
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ import 'package:http/http.dart' as http;
6
+ import 'package:http_retry/http_retry.dart' ;
7
+
8
+ Future <void > main () async {
9
+ final client = RetryClient (http.Client ());
10
+ try {
11
+ print (await client.read ('http://example.org' ));
12
+ } finally {
13
+ client.close ();
14
+ }
15
+ }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ description: HTTP client middleware that automatically retries requests.
5
5
homepage : https://github.com/dart-lang/http_retry
6
6
7
7
environment :
8
- sdk : ' >=2.0 .0 <3.0.0'
8
+ sdk : ' >=2.1 .0 <3.0.0'
9
9
10
10
dependencies :
11
11
async : ^2.0.7
You can’t perform that action at this time.
0 commit comments