http_client_helper 3.0.0 copy "http_client_helper: ^3.0.0" to clipboard
http_client_helper: ^3.0.0 copied to clipboard

A Flutter plugin for http request with cancel and retry fuctions.

http_client_helper #

pub package

A Flutter plugin for http request with cancel and retry fuctions.

Usage #

To use this plugin, add http_client_helper as a dependency in your pubspec.yaml file.

Example #

  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.

30
likes
160
points
231k
downloads

Publisher

verified publisherfluttercandies.com

Weekly Downloads

A Flutter plugin for http request with cancel and retry fuctions.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on http_client_helper