shelf_client 0.0.1 copy "shelf_client: ^0.0.1" to clipboard
shelf_client: ^0.0.1 copied to clipboard

unlisted

HTTP client based on shelf package.

example/example.dart

import 'dart:convert';

import 'package:shelf_client/shelf_client.dart';

Future<void> main(List<String> arguments) async {
  var client = Client();

  var response = await client.get(Uri(
    scheme: 'https',
    host: 'www.googleapis.com',
    path: 'books/v1/volumes',
    queryParameters: {'q': '{http}'},
  ));

  if (response.statusCode == 200) {
    var stringBody = await response.readAsString();
    var jsonResponse = jsonDecode(stringBody) as Map<String, Object?>;
    var itemCount = jsonResponse['totalItems'];
    print('Number of books about http: $itemCount.');
  } else {
    print('Request failed with status: ${response.statusCode}.');
  }

  client.close();
}
0
likes
0
points
97
downloads

Publisher

unverified uploader

Weekly Downloads

HTTP client based on shelf package.

Homepage
Repository (GitHub)
View/report issues

Topics

#client #http #shelf

License

unknown (license)

Dependencies

shelf

More

Packages that depend on shelf_client