-
Notifications
You must be signed in to change notification settings - Fork 4
/
613.txt
66 lines (53 loc) · 3.82 KB
/
613.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
* 仕様書
[REFS[
- [5] [CITE@en[RFC 7230 - Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing]] ([TIME[2014-06-07 01:59:35 +09:00]] 版) <https://tools.ietf.org/html/rfc7230#section-3.3>
- [1] [CITE@en[RFC 3875 - The Common Gateway Interface (CGI) Version 1.1]] ([TIME[2011-11-20 06:09:05 +09:00]] 版) <http://tools.ietf.org/html/rfc3875#section-4.3.3>
]REFS]
* 応答
[2] [CODE(HTTP)@en[[[HEAD]]]] [[要求]]に対する[[応答]]は、
[[メッセージ本体]]を持ちません [SRC[>>5]]。
;; [3] [CODE(HTTP)@en[[[Content-Length:]]]] や [CODE(HTTP)@en[[[Transfer-Encoding:]]]]
を含んでいることもありますが、これらは [CODE(HTTP)@en[[[GET]]]]
[[要求]]だったとした場合の値であって、 [CODE(HTTP)@en[[[HEAD]]]] に対する[[応答]]の値ではありません。
* 歴史
[FIG[
[FIGCAPTION[
[4] RFC 1945 (HTTP/1.0) 8.2; RFC 2068 (HTTP/1.1) 9.4 HEAD
]FIGCAPTION]
> The HEAD method is identical to GET except that the server [DEL[must not]] [INS[MUST NOT]] return [DEL[any Entity-Body]] [INS[a message-body]]
in the response. The metainformation contained in the HTTP headers in response to a HEAD request [DEL[should]] [INS[SHOULD]]
be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the [DEL[resource identified]] [INS[entity implied]]
by the [DEL[Request-URI]] [INS[request]] without transferring the [DEL[Entity-Body]] [INS[entity-body]]
itself. This method is often used for testing hypertext links for validity,
accessibility, and recent modification.
[CODE(HTTP)[HEAD]] 方式は、サーバーが[[応答]]中で [CODE(ABNF)[[[message-body]]]]
を返しては'''ならない'''点を除いて、 [CODE(HTTP)[[[GET]]]] と同じです。
[CODE(HTTP)[HEAD]] 要求に対する応答の [[HTTP]] 頭並びに含まれる[[メタ情報]]は、
[CODE(HTTP)[GET]] 要求に対する応答で送られる情報と同じである'''べきです'''。
この方式は、要求で暗示した実体についてのメタ情報を
[CODE(ABNF)[[[entity-body]]]] 自体を転送せずに得ることができます。
この方式はしばしば[[ハイパーテキスト]]・[[リンク]]の妥当性,
接続可能性, 最近の修正の検査のために使われます。
[DEL[
> There is no "conditional HEAD" request analogous to the conditional
GET. If an If-Modified-Since header field is included with a HEAD
request, it should be ignored.
条件付 [CODE(HTTP)[GET]] に対応する「条件付 [CODE(HTTP)[HEAD]]」はありません。
[CODE(HTTP)[[[If-Modified-Since]]]] 頭欄が [CODE(HTTP)[HEAD]]
要求に含まれていても、無視するべきです。
]DEL]
[INS[
> The response to a HEAD request [DEL[may]] [INS[MAY]] be cach[INS[e]]able in the sense that the
information contained in the response [DEL[may]] [INS[MAY]] be used to update a
previously cached entity from that resource. If the new field values
indicate that the cached entity differs from the current entity (as
would be indicated by a change in Content-Length, Content-MD5, ETag
or Last-Modified), then the cache MUST treat the cache entry as stale.
[CODE(HTTP)[HEAD]] 要求に対する応答は、応答に含まれる情報を以前にその[[資源]]から[[キャッシュ]]した実体を更新するために使っても'''構わない'''という意味で[[キャッシュ可能]]です。
キャッシュした実体が現在の実体と異なることを新しい欄値が示していたら
([CODE(HTTP)[[[Content-Length]]]], [CODE(HTTP)[[[Content-MD5]]]],
[CODE(HTTP)[[[Content-MD5]]]], [CODE(HTTP)[[[ETag]]]] または
[CODE(HTTP)[[[Last-Modified]]]] の変更で示される)、
キャッシュはキャッシュ項目を[[腐敗]]したものとして扱わなければ'''なりません'''。
]INS]
]FIG]