nanoxhr
Nanoxhr is a small xhr (ajax) library.
Last updated 6 years ago by asbjornenge .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nanoxhr 
SYNC missed versions from official npm registry.

nanoxhr

browser support

Nanoxhr is a small xhr (ajax) library.

2640 B nanoxhr.min.js     // minified
1920 B nanoxhr.min.js.gz  // minified+gzipped

Install

Nanoxhr is available on npm.

npm install nanoxhr

Use

require('nanoxhr')('/api/cakes')
        .method('POST')
        .set('Content-Type','application-json')
        .set('Cookie','monster=2713cea58e115e44b91928d57b48e832;')
        .data(JSON.stringify({topping:'sprinkles'}))
        .query({amount:5})
        .timeout(1000)
        .call(function(res) {
      	    console.log(res.status, res.responseText)
        })

Docs

For full documentation see the spec.

enjoy.

Changelog

1.0.2

  • Removed wonky char cause web breakage

1.0.0

  • MAJOR: Now doing async by default!!
  • Added .sync as .call alias to perform a sync request
  • Added timeout support

0.2.0

  • Wrapping req.send in try-catch for send-error handling via callback

0.0.1

  • Initial release! :tada:

Current Tags

  • 1.0.2                                ...           latest (6 years ago)

4 Versions

  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |