nets
nothin but nets. http client that works in node and browsers
Last updated 5 years ago by zeke .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nets 
SYNC missed versions from official npm registry.

nets

Mac/Linux Windows
Travis Build status

js-standard-style

Nothin but nets. HTTP client that works the same in node and browsers

Uses xhr for browsers and request for node

get

var nets = require("nets")

nets({ url: "http://placekitten.com/g/400/400" }, function(err, resp, body) {
  // body is a Buffer containing the image
})

Note that nets returns data as Buffers by default, in both node and in browsers. You can pass {encoding: undefined} to turn this off.

post

var nets = require("nets")

nets({
  body: '{"foo": "bar"}',
  url: "/foo",
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  }
}, function done (err, resp, body) {

})

Current Tags

  • 3.2.0                                ...           latest (5 years ago)

5 Versions

  • 3.2.0                                ...           5 years ago
  • 3.1.0                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (2)
Downloads
Today 0
This Week 167
This Month 761
Last Day 28
Last Week 245
Last Month 785
Dependencies (2)
Dev Dependencies (2)
Dependents (108)

Copyright 2014 - 2017 © taobao.org |