I am sending curl request from a laravel app to express app. When i trigger curl request then it comes to my express app but i am not able to fetch any data out of it. req.body is empty. Here is the curl request which i am sending from my laravel app. $data contains array of objects.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://some.com/event_upload_manager");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
In my express app, code goes like this
exports.event_uploader = function(req,res){
console.log("Curl Received");
console.log("Body : "+JSON.stringify(req.body));
console.log("Params : "+JSON.stringify(req.params));
console.log("Query : "+JSON.stringify(req.query));
}
I am getting Curl Received then empty request.