Build Status


Primitive utility for asynchronous JSON requests with Dart. Sending JSON data is supported, as well, as simple success/error/always callbacks


Add dependency in your pubspec.yaml

  adaj: any

and run

pub install

Import library

import "package:adaj/adaj.dart" as http;

and now you can make adaj (Asynchronous Dart and JSON) calls

http.get("").done((json) {
  print(json["url"]); //prints ""

Sending data with post

Map data = {"test": 42};"", data).done((json) {

PUT and POST are supported in a similar way. For other HTTP methods you can use ajax(url, {method, data}) method.

http.ajax("", method: "HEAD", data: {}).go();

You also have .fail() and .always() callback hooks and you can chain them as much as you like

http.get(...).done(...).fail(...).always(...).done(...) /* and so on */ .go();