fanoos_http 2.0.0 copy "fanoos_http: ^2.0.0" to clipboard
fanoos_http: ^2.0.0 copied to clipboard

A concise and robust Http client for Dart with no need for code generation or reflection.

fanoos_http #

A concise and robust Http client for Dart.

Using fanoos_http you can write concise client code without the need for using reflection or code generation.

Usage #

A simple usage example:

import 'package:fanoos_http/fanoos_http.dart';

const host = 'https://www.blog.com/api/v1';

Future<Post> getPost(int id) => httpGet(
      url: '$host/posts/$id',
      bodyParser: jsonDecode,
      onOk: (json) => Post.fromJson(json),
    );


Future<List<Post>> getPosts() => httpGet(
      url: '$host/posts',
      bodyParser: jsonDecode,
      onOk: (json) => json['posts'].map((p) => Post.fromJson(p)).toList(),
    );

For the full example, please check the example tab.

0
likes
40
points
44
downloads

Publisher

verified publisheraligator.ir

Weekly Downloads

A concise and robust Http client for Dart with no need for code generation or reflection.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

http

More

Packages that depend on fanoos_http