Currently I am developing an API using the FOSRestBundle in Symfony2. Using cURL I post a JSON object to a controller's action using command line, which in return parses a file and uploads it to S3.
So far so good, but I wish debugging the cURL response was a bit easier. When an error 500 is thrown in Symfony, my cURL response contains a huge amount of HTML. Is there a way to catch the exception message in a human readable format for the command line?
As suggested if your query ask for JSON your error 500 should also returns JSON.
The Postman extension is good, but the easiest way to test your FOSRestBundle API is the use a Symfony2 bundle like NelmioApiDocBundle. You will be able to test all your API actions with a sandbox and to document your whole API.