Skip to content

Instantly share code, notes, and snippets.

@navicore
Created June 25, 2015 04:26
Show Gist options
  • Select an option

  • Save navicore/0d7f71ffa0c985186220 to your computer and use it in GitHub Desktop.

Select an option

Save navicore/0d7f71ffa0c985186220 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
'use strict';
var request = require('request'),
log4js = require("log4js"),
LOG = log4js.getLogger('example');
request({
url: 'http://requestb.in/up1rw2up',
method: 'POST',
json: {
field1: 'data',
field2: 'data'
}
}, function(error, response, body) {
if(error) {
console.log(error);
} else {
console.log(response.statusCode, body);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment