BuckleScript bindings for SuperAgent.
Incomplete. The published version may lag behind the GitHub repo – feel free to file a bug if this is the case.
npm i @ryb73/bs-superagent
Example:
open Superagent;
open Js.Promise;
get("api/")
|> withCredentials
|> query("key", "value")
|> end_
|> then_((resp) => {
switch (resp.body) {
| None => Js.log("No Body")
| Some(body) => Js.Json.decodeObject(body) |> doSomething
};
resolve();
});
See test/index.re
and https://visionmedia.github.io/superagent/ for more.