1.0.2 • Published 10 years ago

json-http v1.0.2

Weekly downloads
22
License
ISC
Repository
github
Last release
10 years ago

json-http

A simple wrapper for making an http get request to a JSON endpoint in Node.js. Includes the ability to set a timeout.

var jsonHttp = require('json-http');

jsonHttp.getJson('http://localhost/api', function(err, response) {
	console.log(response);      
});

Using Timeout

var jsonHttp = require('json-http');
var timeoutInMilliSeconds = 2000;

jsonHttp.getJson('http://localhost/api', timeoutInMilliSeconds, function(err, response) {
	console.log(response);      
});