node.js module for json-http requests
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
README.md
package.json

README.md

Overview

HTTP JSON helper function.

Tested with node.js versions:

0.10 0.8 0.6

Build Status

Usage

Arguments order are detected automatically.

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

Usage:

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

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

Installation

npm install http-json-request