I'm trying to migrate an existing web app to the Lithium framework.
If I POST JSON-encoded data to an URL and set the Content-Type header to application/json
on the request, the POST'd data is automatically parsed and available in the controller (as $this->request->data
). Hooray.
However, I need to support a client app which does not set the Content-Type header properly. In this case, the framework assumes it is URL-encoded form data and attempts to parse it as such.
Is there any way to override the request's Content-Type for a particular URL, in time for it to be parsed correctly?