12-05-2019, 02:53 PM
Hello, i tray to create a restFull:
[/url][url=https://codeigniter4.github.io/userguide/incoming/restful.html#id8]https://codeigniter4.github.io/userguide/incoming/restful.html#id8
But alwais the respond is in XML and not Json:
[/url][url=https://codeigniter4.github.io/userguide/incoming/restful.html#id8]https://codeigniter4.github.io/userguide/incoming/restful.html#id8
Code:
class RestMovie extends ResourceController {
protected $modelName = 'App\Models\MovieModel';
protected $format = 'json';
public function index(){
return $this->respond($this->model->findAll());
But alwais the respond is in XML and not Json: