Skip to content
Branch: master
Find file Copy path
Find file Copy path
3 contributors

Users who have contributed to this file

@mit-mit @natebosch @kondasoft
19 lines (16 sloc) 705 Bytes
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.
var url = '{http}';
// Await the http get response, then decode the json-formatted response.
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}.');
You can’t perform that action at this time.