When I'm doing a request into API that I've written using Symfony 2.5. I'm sending form data using POST method and in the controller I'm doing
$params = json_decode($request->getContent(), true);
and if I do
var_dump($params);
I can see everything in console If I'm doing
console.log(data)
But If I try just do something like this:
array_keys($params)
Server returns me a 500 status code and error:
XMLHttpRequest cannot load http://host.loc/app_dev.php/posts. Invalid HTTP status code 500