A declarative http client based off superagent. Versions available for both the browser and node with the same API and shared test suite.
Installation
npm install solicit
then in your app:
import {get,post,del} from 'solicit'
Example
get('component.io/components/all').read(console.log) // => a whole lot of JSON
API
Each http verb has a corresponding helper function for making that type of request. Each function will return a Request. Requests are deferred results so you are free to configure them as much as you like with the methods mentioned below then call read() or then() to actually send the request and read the response. The main verbs you will be using are:
get
post
put
head
del (delete is a reserved word in JS)
Request.set(field:String|Object, val:String)
Set header field to val, or multiple fields with one object.