一个标准的网络请求格式
基础的网络格式
请求
GET /path/to/resource HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
响应
HTTP/1.1 200 OK
Date: Fri, 27 Sep 2024 12:00:00 GMT
Server: Apache/2.4.41 (Unix)
Last-Modified: Wed, 25 Sep 2024 09:15:00 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 1234
Connection: keep-alive
<!DOCTYPE html>
<html>
<head>
<title>Example Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<!-- 页面内容 -->
</body>
</html>
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 EmccK
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果