A ClojureScript HTTP library that uses promises!
You might not want to use core.async
or callbacks to handle responses from HTTP requests. Promises are functional concept that are embraced in the Javascript community. Or maybe you want a library that aims to do one thing and one thing well - HTTP requests.
If you want a HTTP library that does everything, this one isn't for you.
This library won't deal with encoding of the request body into your required format, it won't decode your response, it won't set content-type headers, it won't set accept headers. That's all up to you.
The request object passed to this library should take the form of the Ring request map. Requests will immediately return a promise that will eventually be resolved to contain a Ring response map. The implementation of promises used comes from Promesa. Non-sucessful HTTP requests will be rejected but the value contained in the promise will still be a Ring response map. Success is defined by the isSuccess()
method on the XhrIo response
TODO
# with nix to add nodejs otherwise we'll assume you've installed it yourself
nix-shell
# Install test dependencies
npm install
# Run the test server in the background
docker-compose up -d
# Run the tests
boot test-all
TODO
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close