simple_http_extension 0.0.11 copy "simple_http_extension: ^0.0.11" to clipboard
simple_http_extension: ^0.0.11 copied to clipboard

A http helper class that detect remote protocol (max-age) and support local cache.

example/main.dart

import 'package:simple_http_extension/simple_http_extension.dart';

void main() async {
  var httpEx = HttpEx();

  // Example usage of performing an HTTP GET request
  var url = 'https://jsonplaceholder.typicode.com/posts/1';
  try {
    var response = await httpEx.get(url);
    print('Response: $response');
  } catch (e) {
    print('Error: $e');
  }

  // Example usage of performing an HTTP GET request without caching
  var anotherUrl = 'https://jsonplaceholder.typicode.com/posts/2';
  try {
    var response = await httpEx.forceGet(anotherUrl);
    print('Response: $response');
  } catch (e) {
    print('Error: $e');
  }
}
0
likes
160
pub points
0%
popularity

Publisher

unverified uploader

A http helper class that detect remote protocol (max-age) and support local cache.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, http, logger

More

Packages that depend on simple_http_extension