我有一些原始格式的HTTP请求,例如
GET /docs/index.html HTTP/1.1
Host: www.nowhere123.com
Accept: image/gif, image/jpeg, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
(blank line)
我要测试和调试他们为这个原因,我需要一个简单的方法重复了我的电脑,我怎么可以从原始数据使用HTTP请求curl
,httpie
或其他CLI HTTP客户端?
我建议使用telnet:telnet www.nowhere123.com 80
并且您正在与服务器进行原始交谈。
例子:
telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /index.htm
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https:///index.htm">here</a>.</p>
</body></html>
Connection closed by foreign host.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句