nothing but nets. http client that works in node and browsers
JavaScript
Latest commit 2e2050a Oct 19, 2015 @zeke zeke Bump request and xhr versions
Permalink
Failed to load latest commit information.
.gitignore 1.0.0 May 21, 2014
.travis.yml update ci May 21, 2014
appveyor.yml fix readme May 21, 2014
collaborators.md add collaborator Mar 10, 2015
index.js add patches from rexxars Mar 10, 2015
package.json Bump request and xhr versions Oct 19, 2015
readme.md use standard style Mar 10, 2015
test.js add patches from rexxars Mar 10, 2015

readme.md

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

})