CakePHP documentation says:
Typically REST applications not only output content in alternate data formats, but also accept data in different formats. In CakePHP, the RequestHandlerComponent helps facilitate this. By default, it will decode any incoming JSON/XML input data for POST/PUT requests and supply the array version of that data in $this->request->data. source
But my $this->request->data
is empty array.
In AppController.php
I load $this->loadComponent('RequestHandler');
That's my RequestHandler debug info
My request data:
Accept: application/json
Content-Type: application/json
{"store_id": 671}
And my request data always is empty, why?
GET
and check it they are empty or not. Ex:http://localhost/URL?key=test
- Aman Rawathttp://localhost/MenuItems/add
- Marcin K.$this->request->data
? - ndm