I'm trying to fetch some data from a server using nodejs. I would like to send a POST
data. There are two things that I would like to know about.
- How do I send the POST data?
- Whatever request I make using GET or POST, I always get a 400-BadRequest error. Have been searching through to solve this the whole day. Was not able to solve.
I'm sending the POST data now like request.write(JSON.stringify({key:"value"}));
.. for which I'm always getting a 400 to whatever site I try this. Even on apache running at 127.0.0.1
on a php file that accepts the POST data.