HTTP 范例

我们接下来要讲解的内容都会用到下面这个范例

我们使用 CURL 发送模拟 GET 请求服务器上的 static/media/hello.txt 文件


shell 命令

curl -v  https://www.fly63.com/static/media/hello.txt


客户端请求信息:

GET /static/media/hello.txt HTTP/1.1
Host: www.fly63.com
User-Agent: curl/7.54.0
Accept: */*


服务端响应:

HTTP/1.1 200 OK
Server: Tengine
Date: Sun, 03 Sep 2017 01:08:42 GMT
Content-Type: text/plain
Content-Length: 38
Last-Modified: Sun, 03 Sep 2017 01:08:21 GMT
Connection: keep-alive
ETag: "59ab5605-26"
Strict-Transport-Security: max-age=31536000;includeSubdomains;preload
X-Frame-Options: DENY
Accept-Ranges: bytes

输出结果:

你好,世界

链接: https://fly63.com/course/17_915