Man, that error is the bane of my existence.
One thing that helped me: validating the request *right before* sending it. Use a tool like JSONLint for your payloads, and maybe even a header checker (some IDEs have plugins for this).
Also, is the API RESTful? Sometimes trailing slashes or wrong HTTP methods trigger this code is usually caused by an invalid request.
One thing that helped me: validating the request *right before* sending it. Use a tool like JSONLint for your payloads, and maybe even a header checker (some IDEs have plugins for this).
Also, is the API RESTful? Sometimes trailing slashes or wrong HTTP methods trigger this code is usually caused by an invalid request.
