我試圖將內容類型更改爲Kohana中的application/json。我把這個動作放在我的控制器中:
$this->request->headers('Content-Type', 'application/json');
$this->content = json_encode($json_data);
然而,請求仍然是text/html內容類型。
我應該在哪裏放$this->request->headers('Content-Type', 'application/json');
?