-
Notifications
You must be signed in to change notification settings - Fork 4
/
341.txt
171 lines (128 loc) · 9.89 KB
/
341.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
[10] [DFN[[CODE(HTTP)@en[[[GET]]]]]] は、[[対象資源]]を転送することを要求する
[[HTTP]] [[要求メソッド]]です。
[12] [CODE(HTTP)@en[[[GET]]]] は [[HTTP]] における最も重要で基本的な[[メソッド]]です。
単に [[HTTP]] によってアクセスするというとき、ほとんどの場合は
[CODE(HTTP)@en[[[GET]]]] [[要求]]を送信して[[応答]]を受け取ることをいいます。
* 仕様書
[REFS[
- [19] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-07-01 17:07:49 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#page-22>
-- [9] '''[CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-4.3.1>'''
-- [3] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-4.2.1>
-- [5] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-4.2.2>
-- [6] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-06-07 01:55:45 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-4.2.3>
- [24] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-08-07 05:54:02 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#appendix-B>
- [26] [CITE@en[RFC 1945 - Hypertext Transfer Protocol -- HTTP/1.0]] ([TIME[2014-09-07 13:12:32 +09:00]] 版) <http://tools.ietf.org/html/rfc1945#section-4.1>
- [2] [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.1>
- [8] [CITE@en[RFC 7252 - The Constrained Application Protocol (CoAP)]]
( ([TIME[2014-06-27 00:59:37 +09:00]] 版))
<http://tools.ietf.org/html/rfc7252#section-5.8.1>
]REFS]
* 意味
[11] [CODE(HTTP)@en[[[GET]]]] [[メソッド]]は、[[対象資源]]の現在の選択されている[[表現]]を転送することを要求するものです
[SRC[>>9]]。
[13] [CODE(HTTP)@en[[[Range:]]]] [[ヘッダー]]を[[要求]]に含めることで、
[CODE(HTTP)@en[[[GET]]]] [[要求]]は[[範囲要求]]となり、
選択された[[表現]]の部分を転送することを要求するものとなります [SRC[>>9]]。
* 構文
[14] [CODE(HTTP)@en[[[GET]]]] [[要求]]の [[payload]] の意味は、定義されていません [SRC[>>9]]。
[15] [[実装]]によってはそのような[[要求]]を却下するものもあります [SRC[>>9]]。
;; [23] これは[[要求メソッド]]に依存しない[[メッセージ]]の[[構文解析]]のために規定を緩和したもの
[SRC[>>24]] とされています。しかし [[RFC 2616]] のどこでそのような制限が規定されていたのか不明です。
* 文脈
[27] [[HTTP/0.9]] では [CODE(HTTP)@en[[[GET]]]] が唯一認められている[[要求メソッド]]となっています [SRC[>>26]]。
* 性質
[20] 一般目的の [[HTTP]] [[鯖]]は、 [CODE(HTTP)@en[[[GET]]]]
を実装しなければ[['''なりません''']] [SRC[>>19]]。
[4] [CODE(HTTP)@en[[[GET]]]] は、[[安全なメソッド]] [SRC[>>3]] で、
[[冪等なメソッド]]です [SRC[>>5]]。
[7] [CODE(HTTP)@en[[[GET]]]] は、[[キャッシュ可能]]です [SRC[>>6, >>9]]。
[[キャッシュ]]は、 [CODE(HTTP)@en[[[Cache-Control:]]]] によって別途指定がない限り、
[CODE(HTTP)@en[[[GET]]]] [[要求]]に対する[[応答]]を以後の [CODE(HTTP)@en[[[GET]]]]
や [CODE(HTTP)@en[[[HEAD]]]] の処理のために使って構いません [SRC[>>9]]。
[21] [CODE(HTTP)@en[[[POST]]]] に対する[[応答]]が [CODE(HTTP)@en[[[GET]]]]
[[要求]]の処理に使われることがあります。
;; [CODE(HTTP)@en[[[POST]]]] の項を参照してください。
[22] [CODE(HTTP)@en[[[HEAD]]]] に対する[[応答]]によって既存の
[CODE(HTTP)@en[[[HEAD]]]] に対する[[応答]]の[[キャッシュ]]が影響されることがあります。
* 歴史
[FIG(quote)[
[FIGCAPTION[
[16] RFC 1945 (HTTP/1.0) 8.1; RFC 2068・2616 (HTTP/1.1) 9.3 GET
]FIGCAPTION]
> The GET method means retrieve whatever information (in the form of an
entity) is identified by the Request-URI. If the Request-URI refers
to a data-producing process, it is the produced data which shall be
returned as the entity in the response and not the source text of the
process, unless that text happens to be the output of the process.
[CODE(HTTP)[GET]] 方式は、 [CODE(ABNF)[[[Request-URI]]]] でどんな
([[実体]]の形の) 情報が識別されるのであれ、それを取り出すことを意味します。
[CODE(ABNF)[Request-URI]] がデータ生成過程を指しているのであれば、
応答で実体として返されるものは生成されたデータであって、
その過程の原始文ではありません。
(その原始文が過程の出力であったりする場合を除いて。)
> The semantics of the GET method change[DEL[s]]
to a "conditional GET" if the request message includes an If-Modified-Since[INS[, If-Unmodified-Since, If-Match, If-None-Match, or If-Range]] header field.
A conditional GET method requests that the [DEL[identified resource]] [INS[entity]] be transferred only [DEL[if it has been modified since the date given by the If-Modified-Since header, as described in Section 10.9]] [INS[under the circumstances described by the conditional header field(s)]].
The conditional GET method is intended to reduce [INS[unnecessary]]
network usage by allowing cached entities to be refreshed without requiring multiple requests or transferring [DEL[unnecessary data]] [INS[data already held by the client]].
[CODE(HTTP)[GET]] 方式の意味は、要求メッセージが
[CODE(HTTP)[[[If-Modified-Since]]]], [CODE(HTTP)[[[If-Unmodified-Since]]]],
[CODE(HTTP)[[[If-Match]]]], [CODE(HTTP)[[[If-None-Match]]]],
あるいは [CODE(HTTP)[[[If-Range]]]] 頭欄を含んでいるときは
「条件付 [CODE(HTTP)[GET]]」に変わります。
条件付 [CODE(HTTP)[GET]] 方式は、実体が[[条件頭欄]](群)で説明される状況にあるときにのみ実体を転送することを要求します。
条件付 [CODE(HTTP)[GET]] 方式は、キャッシュされた実態を複数の要求を必要としたり既にクライアントが持っているデータを転送したりせずに更新することを可能とし、
不必要なネットワーク使用を削減することを意図したものです。
[INS[
> The semantics of the GET method change to a "partial GET" if the
request message includes a Range header field. A partial GET requests
that only part of the entity be transferred, as described in section [DEL[14.36]] [INS[14.35]]. The partial GET method is intended to reduce unnecessary
network usage by allowing partially-retrieved entities to be
completed without transferring data already held by the client.
要求メッセージが [CODE(HTTP)[[[Range]]]] 頭欄を含んでいる時、
[CODE(HTTP)[GET]] 方式の意味は「部分 [CODE(HTTP)[GET]]」
に変わります。
部分 [CODE(HTTP)[GET]] 要求は、実体の一部のみを転送します。
部分 [CODE(HTTP)[GET]] 方式は、部分的に取り出した実体を、クライアントが既に持っているデータを転送せずに完全にすることを可能とし、不必要なネットワーク使用を削減することを意図しています。
> The response to a GET request is cach[INS[e]]able if and only if it meets the
requirements for HTTP caching described in section 13.
[CODE(HTTP)[GET]] 要求への応答は、13章で説明している [[HTTP]] [[キャッシュ]]要件に合致すれば、
その場合に限って、[[キャッシュ可能]]です。
[INS[
> See section 15.1.3 for security considerations when used for forms.
[[フォーム]]での使用時の安全性についての考察 15.1.3節をご覧あれ。
]INS]
]INS]
]FIG]
[REFS[
- [25] [CITE@en[RFC 2324 - Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)]] ([TIME[2014-10-06 15:21:16 +09:00]] 版) <http://tools.ietf.org/html/rfc2324#section-2.1.2>
]REFS]
[FIG(quote)[
[FIGCAPTION[
[17] RFC 2324 (HTCPCP/1.0) 2.1.2 GET method
]FIGCAPTION]
> In HTTP, the GET method is used to mean "retrieve whatever
information (in the form of an entity) identified by the Request-URI." If the Request-URI refers to a data-producing process, it is
the produced data which shall be returned as the entity in the
response and not the source text of the process, unless that text
happens to be the output of the process.
HTTP では、 [CODE(HTTP)[GET]] method
は「([[実体]]の形で) [[Request-URI]]
で識別される何かの情報を取り出す」ことを意味するのに使っています。
Request-URI がデータ生産過程を参照しているなら、
応答で実体として返されるのは処理したデータであって、
(処理の原始文が処理の出力でない限り)
処理の原始文ではありません。
> In HTCPCP, the resources associated with a coffee pot are physical,
and not information resources. The "data" for most coffee URIs
contain no caffeine.
HTCPCP では、珈琲ポットと関連付けられた資源は物理的存在であり、
情報資源ではありません。
ほとんどの珈琲 URI の「データ」はカフェインを含みません。
]FIG]
* 関連
[18] [CODE(HTTP)@en[[[HEAD]]]] は、 [CODE(HTTP)@en[[[GET]]]] の[[応答]]のうち[[ヘッダー]]部分のみの転送を要求するものです。
* メモ
[1]
[CODE(HTTP)@en[[[GET]]]] でも[[実体]]を[[要求メッセージ]]に含めることはできます。
が、世間からは忘れ去られているのでしょうか。。。