Skip to content

Instantly share code, notes, and snippets.

@cianclarke
Created December 1, 2014 21:36
Show Gist options
  • Save cianclarke/21aacdd06f22d33e663c to your computer and use it in GitHub Desktop.
Save cianclarke/21aacdd06f22d33e663c to your computer and use it in GitHub Desktop.
Form Data
var request = require('request'),
jsdom = require('jsdom'),
jar = request.jar(), // stores cookies in the "jar", we can re-use them in future authenticated requests
// A closure function to enclose our code within
(function(username, password){
request.post({
url : 'https://testing.feedhenry.me/box/srv/1.1/act/sys/auth/login',
jar : jar,
form : {
u : username,
p : password,
d : "testing"
},
}, function(err, res, body){
if (err){
console.error(err);
return;
}
});
})("blog@demo.com", "Blogpost123");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment