【发布时间】:2015-11-12 15:40:49
【问题描述】:
我正在尝试在我们的 CakePHP 3 应用程序中访问 Apache 响应标头。
apache_response_headers() 和 headers_list() 给出了这个数据:
response headers:Array
(
[Expires] => Thu, 19 Nov 1981 08:52:00 GMT
[Cache-Control] => no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[Pragma] => no-cache
)
headers list:Array
(
[0] => Expires: Thu, 19 Nov 1981 08:52:00 GMT
[1] => Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[2] => Pragma: no-cache
)
当我从浏览器检查响应标头时,我还会看到以下值:“content-encoding, content-length, content-type, date, ms-author-via, server, status, vary, via, x-original-内容长度,x-powered-by”。 Cakephp 的响应对象有 get all headers 方法吗? https://github.com/cakephp/cakephp/blob/3.0.11/src/Network/Response.php
如何获取所有响应标头?
【问题讨论】: