iws_http 0.2.0 copy "iws_http: ^0.2.0" to clipboard
iws_http: ^0.2.0 copied to clipboard

unlistedoutdated

Library to facilitate http requests with error handling for Rest API requests.

example/main.dart

import 'dart:convert' as convert;

import 'package:iws_http/iws_http.dart';

void main() async {
  final iwsHttp =
      IwsHttp.setup(authority: 'googleapis.com', basePath: 'books/v1/');

  try {
    var response = await iwsHttp
        .httpGet(path: 'volumes', queryParameters: {'q': '{http}'});
    var jsonResponse =
        convert.jsonDecode(response.body) as Map<String, dynamic>;
    var itemCount = jsonResponse['totalItems'];

    print('Number of books about http: $itemCount.');
  } on ApiException catch (e) {
    print('Request failed with status: ${e.httpCode}.');
  }
}
0
likes
0
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

Library to facilitate http requests with error handling for Rest API requests.

Homepage

License

unknown (license)

Dependencies

flutter, http

More

Packages that depend on iws_http