1.0.4 • Published 9 years ago

sugar-xhr v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

sugar-xhr

Usage

import { post } from 'sugar-xhr'
let options =  { headers: { 'X-Foo': 'bar' } }

post('http://foobar.com', { foo: 'bar' }, opts).then(function(resp) {
	console.log(resp.body)
})
import get from 'sugar-xhr/get'

get('http://google.com').then(function(resp) {
	console.log(resp.text)
})

Methods

get(url: String, data?: PlainObject, opts?: PlainObject)

Using the data parameter will encode the object into the url's querystring. Options are passed directly to superagent.

post(url: String, data?: PlainObject, opts?: PlainObject)

put(url: String, data?: PlainObject, opts?: PlainObject)

del(url: String, opts?: PlainObject)

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago