![](/img/trans.png)
[英]Where do I put $this->request->headers('Content-Type', 'application/json');
[英]Kohana 3.2 request->headers['Content-Type'] keeps failing
由於某些原因,這在Kohana 3.2中不起作用:
$this->request->headers['Content-Type'] = 'text/xml';
自Kohana 3.1以來有沒有改變?
它也不應該在3.1中工作,但這應該:
$this->request->headers('Content-Type', 'text/xml');
請參閱http://kohanaframework.org/3.2/guide/api/Request#headers這是3.1中的請求/響應重構更改之一。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.