diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-11 12:56:40 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 12:56:40 +0100 |
commit | 310fd066e91f454b990372ffa30e803cc8120975 (patch) | |
tree | d5d900deb656a5da18e0b60d00f0db73f3a2e88e /files/zh-cn/glossary/请求头 | |
parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
download | translated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.gz translated-content-310fd066e91f454b990372ffa30e803cc8120975.tar.bz2 translated-content-310fd066e91f454b990372ffa30e803cc8120975.zip |
unslug zh-cn: move
Diffstat (limited to 'files/zh-cn/glossary/请求头')
-rw-r--r-- | files/zh-cn/glossary/请求头/index.html | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/files/zh-cn/glossary/请求头/index.html b/files/zh-cn/glossary/请求头/index.html deleted file mode 100644 index 666ace7ea4..0000000000 --- a/files/zh-cn/glossary/请求头/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Request header(请求头) -slug: Glossary/请求头 -tags: - - HTTP - - 术语 -translation_of: Glossary/Request_header ---- -<p><strong>请求头</strong>是 {{glossary("header", "HTTP 头")}}的一种,它可在 HTTP 请求中使用,并且和请求主体无关 。某些请求头如 {{HTTPHeader("Accept")}}、{{HTTPHeader("Accept-Language", "Accept-*")}}、 {{HTTPHeader("If-Modified-Since", "If-*")}} 允许执行条件请求。某些请求头如:{{HTTPHeader("Cookie")}}, {{HTTPHeader("User-Agent")}} 和 {{HTTPHeader("Referer")}} 描述了请求本身以确保服务端能返回正确的响应。</p> - -<p>并非所有出现在请求中的 HTTP 首部都属于请求头,例如在 {{HTTPMethod("POST")}} 请求中经常出现的 <a href="https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Content-Length" title="Content-Length 是一个实体消息首部,用来指明发送给接收方的消息主体的大小,即用十进制数字表示的八位元组的数目。"><code>Content-Length</code></a> 实际上是一个代表请求主体大小的 <a href="https://developer.mozilla.org/en-US/docs/Glossary/entity_header" title="entity header: An entity header is an HTTP header describing the content of the body of the message. Entity headers are used in both, HTTP requests and responses. Headers like Content-Length, Content-Language, Content-Encoding are entity headers.">entity header</a>,虽然你也可以把它叫做请求头。</p> - -<p>此外,CORS 定义了一个叫做 {{glossary('simple header', 'simple headers')}} 的集合,它是请求头集合的一个子集。如果某次请求是只包含 {{glossary('simple header', 'simple header')}} 的话,则被认为是简单请求,不会触发请求预检({{glossary("preflight request", "preflight")}})。</p> - -<p>下面是一个 HTTP 请求的请求头:</p> - -<pre>GET /home.html HTTP/1.1 -Host: developer.mozilla.org -User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:50.0) Gecko/20100101 Firefox/50.0 -Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 -Accept-Language: en-US,en;q=0.5 -Accept-Encoding: gzip, deflate, br -Referer: https://developer.mozilla.org/testpage.html -Connection: keep-alive -Upgrade-Insecure-Requests: 1 -If-Modified-Since: Mon, 18 Jul 2016 02:36:04 GMT -If-None-Match: "c561c68d0ba92bbeb8b0fff2a9199f722e3a621a" -Cache-Control: max-age=0</pre> - -<p>严格来说在这个例子中的 {{HTTPHeader("Content-Length")}} 不是一个请求头,而是一个实体头({{glossary("entity header")}}):</p> - -<pre>POST /myform.html HTTP/1.1 -Host: developer.mozilla.org -User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:50.0) Gecko/20100101 Firefox/50.0 -Content-Length: 128 -</pre> - -<h2 id="深入了解">深入了解</h2> - -<h3 id="技术信息">技术信息</h3> - -<ul> - <li><a href="/zh-CN/docs/Web/HTTP/Headers">HTTP 头部列表</a></li> -</ul> |