This is a simple one I guess :
I would like to make a request on a Node.js
server as I'm currently doing it with cURL. Whatever I try, I get an error 404 from the server.
Here is my valid cURL command which returns a JavaScript object:
curl --data "ajax=1&example=test" http://some-site-example.com
After reading cURL manual and Request manual, here is what I tried in Node.js
:
request.post({'content-type':'application/x-www-form-urlencoded',ajax:'1',example:'test',url:'http://some-site-example.com'}, function(err, result, body) {
if (err) console.log(err);
else console.log(body);
});