我有点困惑,因为当我试图使用curl或Chromes开发工具检查header时,我试图设置的HTTP头没有显示出来。
我设置了以下标题:
<html>
<head>
<meta http-equiv="set-cookie" content="the_name=some_value; path=/" />
</head>
<body>
<p>Hello World.</p>
</body>
</html>我还试图设置以下标题:
<meta http-equiv="refresh" content="2;URL=http://www.example.com" />如果我用PHP设置了一个标头,它就会显示:
<head>
<?php header("refresh:2; URL=site.php"); ?>
</head>为什么我试图通过HTML设置的headers不显示在curl -I或Chrome的开发工具中,我做错了什么?
发布于 2018-07-30 07:52:26
http-equiv试图将等效为header,但它不是一种设置真正 HTTP报头的方法。
set-cookie不是http-equiv的有效值https://stackoverflow.com/questions/51589155
复制相似问题