很难说出这里问的是什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或言辞激烈,无法以目前的形式合理回答。如需帮助澄清此问题以便可以重新打开,visit the help center .
9年前关闭。
我想看起来像 HTTP response header
好像..
我正在使用 PHP...
特别是我想看到一个典型的 HTTP 404 响应 header ..
如果有一个包含所有 http header 信息的 php 服务器数组,我想找到它!!
上面的数组有他的元素顺序,哪个先发送?
提前谢谢!!
我的电脑上安装了wireshark,但我不知道如何搜索http响应消息!!
最佳答案
nc(1)
netcat 工具可以很容易地做到这一点,假设您配置了某种类型的 Web 服务器:
$ echo -n -e "GET /does_not_exit HTTP/1.1\r\nHost: localhost\r\n\r\n" | nc localhost 80
HTTP/1.1 404 Not Found
Server: nginx/0.8.54
Date: Mon, 02 Jan 2012 02:33:17 GMT
Content-Type: text/html
Content-Length: 169
Connection: keep-alive
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/0.8.54</center>
</body>
</html>
$
关于php - 典型的 404 响应消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8696951/