简体   繁体   English

Kohana 3.2 request-> headers ['Content-Type']一直失败

[英]Kohana 3.2 request->headers['Content-Type'] keeps failing

This won't work in Kohana 3.2 for some reason: 由于某些原因,这在Kohana 3.2中不起作用:

$this->request->headers['Content-Type'] = 'text/xml';

Has this changed since Kohana 3.1? 自Kohana 3.1以来有没有改变?

It should not work in 3.1 either, but this should: 它也不应该在3.1中工作,但这应该:

$this->request->headers('Content-Type', 'text/xml');

See http://kohanaframework.org/3.2/guide/api/Request#headers This was one of the Request/Response refactoring changes from 3.1. 请参阅http://kohanaframework.org/3.2/guide/api/Request#headers这是3.1中的请求/响应重构更改之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM