http-json-request

Node.js module for simplify json http requests

npm install http-json-request
6 downloads in the last week
15 downloads in the last month

Overview

HTTP JSON helper function.

Usage

Arguments order are detected automatically.

  • getJSON()
  • postJSON()
  • deleteJSON()
  • putJSON()
  • updateJSON()
  • copyJSON()
  • moveJSON()
  • searchJSON()

Usage:

var httpJson = require('http-json');
httpJson.postJSON('server', {my: jsonObject}, function(error, responseObject){
  console.log(error|responseObject);
});

var httpJson = require('http-json');
httpJson.defaultHost('server');
httpJson.defaultPort(3010);
httpJson.postJSON({my: jsonObject}, function(error, responseObject){
  console.log(error|responseObject);
});
httpJson.putJSON({my: jsonObject}, function(error, responseObject){
  console.log(error|responseObject);
});
httpJson.getJSON({my: jsonObject}, 'server2', function(error, responseObject){
  console.log(error|responseObject);
});
npm loves you