Skip to content

Instantly share code, notes, and snippets.

@lazywithclass
Created January 31, 2012 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lazywithclass/1713723 to your computer and use it in GitHub Desktop.
Save lazywithclass/1713723 to your computer and use it in GitHub Desktop.
POST with @mikeal request
request({
method: "POST",
uri: "http://example.com/action",
json: {
foo: "foo",
bar: "bar"
}
}, function (error, response, body) {
if(response.statusCode === 201){
console.log("posted");
} else {
console.log("status code was "+response.statusCode);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment