request_api 2.1.0 icon indicating copy to clipboard operation
request_api: ^2.1.0 copied to clipboard

A wrapper of Dart http package.

RequestAPI #

A wrapper of Dart http package.

Getting started #

import 'package:request_api/request_api.dart';

class ExampleApi {
  static void init() {
    // RequestAPI.init(authority, bearerToken);
    RequestAPI.init('example.com', 'Bearer Example');
  }

  static Future<Model> getModel(
    String arg, {
    http.Client client,
  }) async {
    var data = await Request.get('api/model/$arg', client: client);
    var parser = () => parseItem<Model>(
          data.body,
          Model.fromJson,
        );
    var result = await tryParse(parser);
    return result;
  }
}

IMPORTANT: outdated Readme.

0
likes
105
pub points
17%
popularity

Publisher

unverified uploader

A wrapper of Dart http package.

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

http

More

Packages that depend on request_api