Closed birdy247 closed 6 years ago
Do you including RequestHandlerMiddleware before ApiMiddleware.
Thanks, this solved it. Couldnt see any mention in the docs. We are using 2 pieces of middleware now, ApiMiddleware and RequestHandlerMiddleware. Are there any others we should use?
No, that's all you need.
On latest version of cakeapi
When we inspect $this->getData(), it is always an empty array (for POST, PUT)
We have to use this to retrieve the request payload:
$data = $this->getService()->getRequest()->input('json_decode', true);
request url /myapp/api/v1/example
headers: 'Content-Type': 'application/json', 'Accept': 'application/json'