node-curl
node-curl copied to clipboard
Request using POST
Hello,
I can't find anything about this in the provided documentation. Is it possible to make POST requests ( and send along some parameters )? Thanks!
I have the same question - any examples?
According to http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
var qs = require('querystring');
var curl = require('node-curl');
var opts = {
POST: 1,
POSTFIELDS: qs.stringify({
fleld1: someValue1,
field2: someValue2
})
};
curl(targetUrl, opts, function(err) {
console.log(this.body);
});
This should print body of the HTTP response.