nets

3.2.0 • Public • Published

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) {
 
})

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.2.0
    5,089
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.2.0
    5,089
  • 3.1.0
    0
  • 3.0.0
    0
  • 2.0.0
    2
  • 1.0.0
    1

Package Sidebar

Install

npm i nets

Weekly Downloads

5,092

Version

3.2.0

License

ISC

Last publish

Collaborators

  • maxogden
  • zeke