http 0.12.0+2 copy "http: ^0.12.0+2" to clipboard
http: ^0.12.0+2 copied to clipboard

outdated

A composable, cross-platform, Future-based API for making HTTP requests.

example/main.dart

import 'dart:convert' as convert;
import 'package:http/http.dart' as http;

main(List<String> arguments) async {
  // This example uses the Google Books API to search for books about http.
  // https://developers.google.com/books/docs/overview
  var url = "https://www.googleapis.com/books/v1/volumes?q={http}";

  // Await the http get response, then decode the json-formatted responce.
  var response = await http.get(url);
  if (response.statusCode == 200) {
    var jsonResponse = convert.jsonDecode(response.body);
    var itemCount = jsonResponse['totalItems'];
    print("Number of books about http: $itemCount.");
  } else {
    print("Request failed with status: ${response.statusCode}.");
  }
}
8k
likes
0
points
7.65M
downloads

Publisher

verified publisherdart.dev

Weekly Downloads

A composable, cross-platform, Future-based API for making HTTP requests.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

async, http_parser, path, pedantic

More

Packages that depend on http