Open hifizz opened 5 years ago
请求报文格式:
<methods> <request url> <version>
<header>
[blank line, non-existent, just tips]
<entity>
响应报文格式:
<version> <status> <reason-phrase>
<header>
[blank line, non-existent, just tips]
<entity>
以下两个实例为访问 https://github.com 的 request header: 👇
请求报文实例:
GET / HTTP/1.1
Host: github.com
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,la;q=0.7
Cookie: _octo=GH1.1.1088249963.1512747278; _ga=GA1.2.331878469.1512747278; user_session=AmMn9JXsab7sLeAwNu9_wOmzBjaff5L8yt9mKA2-0yTJU7YI; __Host-user_session_same_site=AmMn9JXsab7sLeAwNu9_wOmzBjaff5L8yt9mKA2-0yTJU7YI; logged_in=yes; dotcom_user=hifizz; tz=Asia%2FShanghai; ignored_unsupported_browser_notice=false; has_recent_activity=1; _gat=1; _gh_sess=REFqQkFBY0ltcTQ4ZEdoZ2xybGYxTFUwaCsyY1hQNHp1ZVMzZ0xjTXRCMkE5K0hiaEIrTFUwakVod1VsNTF1ZHhBTkd3bzR4SGp3dVNHU3ROdHVVWHBaQUZJTHFrWjNqZUlqU2tCNTQybitlUTJnaC9WRmZVRmN3Tk1sbERYdkZnaUl1VTAwajZaaDNJUTFVK2tmV2xzWWlZN3dBL0wyKzVRMzlIeHUwVUFwYmt4SnlCclNKNlQrK0ozRlAzbXNTMXUzZE9YYjViR3p4dFZtZGtjeWNZVkIzbEd5MDM1dkpqWVRqM0hzTkxuQWc0WjNGcXEzVUcrZUlod01YSkxQVXRTMEFiQzFQMGZNTEdWL2RRd25HbFFPTDJuT2h3OXZxTFJrbk51K1ZsU1E9LS1ZUXpVeUx1czAwOVhxREdmSStLQUVBPT0%3D--dd380615533489887d6333f145c2f5cf3cc5945b
If-None-Match: W/"3daeefc7e46bb1ab6706bae86fb31809"
响应报文实例:
Cache-Control: max-age=0, private, must-revalidate
Content-Encoding: gzip
Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; connect-src 'self' uploads.github.com www.githubstatus.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com wss://live.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: github.githubassets.com assets-cdn.github.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; manifest-src 'self'; media-src 'none'; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com
Content-Type: text/html; charset=utf-8
Date: Wed, 23 Jan 2019 09:15:49 GMT
ETag: W/"70b7ef96bed667596f738aa53937d4a2"
Expect-CT: max-age=2592000, report-uri="https://api.github.com/_private/browser/errors"
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Server: GitHub.com
Set-Cookie: user_session=AmMn9JXsab7sLeAwNu9_wOmzBjaff5L8yt9mKA2-0yTJU7YI; path=/; expires=Wed, 06 Feb 2019 09:15:48 -0000; secure; HttpOnly
Set-Cookie: __Host-user_session_same_site=AmMn9JXsab7sLeAwNu9_wOmzBjaff5L8yt9mKA2-0yTJU7YI; path=/; expires=Wed, 06 Feb 2019 09:15:48 -0000; secure; HttpOnly; SameSite=Strict
Set-Cookie: has_recent_activity=1; path=/; expires=Wed, 23 Jan 2019 10:15:48 -0000
Set-Cookie: _gh_sess=MWVKMjJSQVdCb0VsZHZpTVVpb09vQVNEZHI0ZHR0QnU5M01VQWVGM3ZNc3hNcVB2dGN5bVFmWjdFdDJFcXhoK1hqNWg4VHRoUFY0WDVqZkVud2Z5QTlmTzFKU2xEVGFNcU5PaGlDK3dhcnFyRHMzRThFakZqbHdVRk5hYlY4Qk5ETExONTJMeVNSc0JFVXAyZUN3QjVKckpGYkswejNsRlRGbTN6eDhPZzV4T3ltRVlZMDdnbVBGeXpwcGJnV3ZDN1pSS1p4ZnNkdmREUlhmV2x6QURWQ0NtUDE5Q2xlSTUyeG1iRXkxRGc4MHZOZU1sQjUwM3VDWXE2NTQ3VHdiZUtVOFREZEdMc0pvVFA1MXE0RHhTUkFLWkgzWmhjbHVMSERDMXk1ODM0eHc9LS1UdzhIN3pkanBUUFlLMkt1MWg2Vm9BPT0%3D--866fbed75c8ba7b29b97ce1274b7c316801227e8; path=/; secure; HttpOnly
Status: 200 OK
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Transfer-Encoding: chunked
Vary: X-PJAX
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-GitHub-Request-Id: 9D65:22AD:6F631B:9FB62D:5C4830C1
X-Request-Id: 4d9aab83-e9d3-4a76-93fa-fd45ead45751
X-XSS-Protection: 1; mode=block
reason-phrase 原因短语,是状态码的可读版本。和状态码成对出现。
分类:
常见的 http 状态码