request_api

Last updated:

0 purchases

request_api Image
request_api Images
Add to Cart

Description:

request api

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;
}
}
copied to clipboard
IMPORTANT: outdated Readme.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.