v3.0.0
http_client_helper
취소 및 재시도 기능을 지원하는 HTTP 요청용 플러터 플러그인입니다.
32좋아요 33.5만30일 다운로드160Pub 점수
AndroidiOSWebmacOSWindowsLinux
취소 및 재시도 기능을 지원하는 HTTP 요청용 플러터 플러그인입니다.
^1.0.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A Flutter plugin for http request with cancel and retry fuctions.
To use this plugin, add http_client_helper as a dependency in your pubspec.yaml file.
cancellationToken = new CancellationToken();
try {
await HttpClientHelper.get(url,
cancelToken: cancellationToken,
timeRetry: Duration(milliseconds: 100),
retries: 3,
timeLimit: Duration(seconds: 5))
.then((response) {
setState(() {
msg = response.body;
});
});
} on TimeoutException catch (_) {
setState(() {
msg = "TimeoutException";
});
} on OperationCanceledError catch (_) {
setState(() {
msg = "cancel";
});
} catch (e) {
setState(() {
msg = "$e";
});
}
Please see the example app of this plugin for a full example.