-
Notifications
You must be signed in to change notification settings - Fork 4
/
477.txt
174 lines (136 loc) · 8.82 KB
/
477.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
172
173
174
[17] [DFN[[RUBYB[[[リスト応答]]]@en[list response]]]]は、[[異体リスト]]を提供するための[[応答]]です。
* 仕様書
[REFS[
- [3] [CITE@en[RFC 2295 - Transparent Content Negotiation in HTTP]] ([TIME[2014-08-31 19:36:42 +09:00]] 版) <http://tools.ietf.org/html/rfc2295#page-7>
- [4] [CITE@en[RFC 2295 - Transparent Content Negotiation in HTTP]] ([TIME[2014-08-31 19:36:42 +09:00]] 版) <http://tools.ietf.org/html/rfc2295#section-8.5>
- [5] '''[CITE@en[RFC 2295 - Transparent Content Negotiation in HTTP]] ([TIME[2014-08-31 19:36:42 +09:00]] 版) <http://tools.ietf.org/html/rfc2295#section-10.1>'''
- [18] [CITE@en[RFC 2295 - Transparent Content Negotiation in HTTP]] ([TIME[2014-08-31 19:36:42 +09:00]] 版) <http://tools.ietf.org/html/rfc2295#section-11.1>
- [20] [CITE@en[RFC 2295 - Transparent Content Negotiation in HTTP]] ([TIME[2014-08-31 19:36:42 +09:00]] 版) <http://tools.ietf.org/html/rfc2295#section-13>
]REFS]
* 意味
[6] [[リスト応答]]は、[[折衝可能資源]]の[[異体リスト]]を返しますが、
[[異体データ]]自体は返しません [SRC[>>5, >>3]]。
* 構文
[12] [[リスト応答]]は任意の[[状態符号]]を使うことができますが、
[CODE(HTTP)[[[300]]]] が最適です [SRC[>>5]]。
;; [13] [[HTTP/1.0]] [[クライアント]]の中には [CODE(HTTP)[[[300]]]]
[[応答]]を黙って無視するものがあることが知られており、かわりに
[CODE(HTTP)[[[200]]]] を使うこともできます [SRC[>>5]]。
[9] [[リスト応答]]は [CODE(HTTP)@en[[[TCN:]] [DFN[[[list]]]]]] を含まなければ[['''なりません''']]
[SRC[>>5, >>4]]。
[10] [[リスト応答]]は [CODE(HTTP)@en[[[Alternates:]]]] [[ヘッダー]]と
[CODE(HTTP)@en[[[Vary:]]]] [[ヘッダー]]を含まなければ[['''なりません''']] [SRC[>>5]]。
;; [14] [CODE(HTTP)@en[[[Vary:]]]] は通常の[[キャッシュ]]が正しく扱えるようにする[['''べきです''']]。 [CODE(HTTP)@en[[[Vary:]] [[*]]]] でも構いませんし、より詳細なものでも構いません。 [SRC[>>5]]
[11] [[リスト応答]]は ([CODE(HTTP)@en[[[HEAD]]]] [[要求]]でなければ)
[[利用者]]が手動で[[最善の異体]]を選択できるような [[payload body]]
を含まなければ[['''なりません''']] [SRC[>>5]]。
* 文脈
[7] [[リスト応答]]は、[[鯖]]が[[要求]]に対する特定の[[最善の異体]]を返したくない、
あるいは返すことが認められていない時に[[生成]]できます [SRC[>>5, >>3]]。
[15] [[リスト応答]]を構築できるのは[[起源鯖]]のみです [SRC[>>5]]。
;; [19] [[透過的折衝可能資源]]も参照。
* 処理モデル
[8] [[利用者エージェント]]は、[[透過内容折衝に対応]]していれば、
[[リスト応答]]を受信したら、自動的に[[最善の異体]]を選択し、
取得し、[[表示]]することができなければ[['''なりません''']] [SRC[>>5, >>18]]。
[[異体]]のいずれも受け入れられないなら、[[エラー]]を[[表示]]できなければ[['''なりません''']]
[SRC[>>18]]。
[16] [[状態符号]]などにもよりますが、基本的に[[リスト応答]]は[[キャッシュ可能]]です [SRC[>>5]]。
[21] [[透過内容折衝に対応]]する[[キャッシュ]]は、[CODE(HTTP)@en[[[Vary:]]]]
[[ヘッダー]]で示された条件が一致しなかったとしても、[[キャッシュ]]された[[新鮮]]な[[リスト応答]]を返すことができます [SRC[>>20]]。
* 歴史
[FIG(quote)[
[FIGCAPTION[
[1] [[RFC 2295]]
]FIGCAPTION]
>
:list response:
A list response returns the variant list of the negotiable
resource, but no variant data. It can be generated when the server
does not want to, or is not allowed to, return a particular best
variant for the request. List responses are defined in section 10.1.
>
[DFN[目録応答]]は、[[折衝可能資源]]の[[変種目録]]を返し、
[[変種]]のデータは返しません。
[[サーバー]]が[[要求]]についての特定の最善変種を返すことを望まないか、
又は返すことが許されていないときに、目録応答を生成することができます。
目録応答は10.1節で定義します。
]FIG]
[FIG(quote)[
[FIGCAPTION[
[2] RFC 2295 (HTTP 透過内容折衝) 10.1 List response
]FIGCAPTION]
> A list response returns the variant list of the negotiable resource,
but no variant data. It can be generated when the server does not
want to, or is not allowed to, return a particular best variant for
the request. If the user agent supports transparent content
negotiation, the list response will cause it to select a best variant and retrieve it.
[[目録応答]]は[[折衝可能資源]]の[[変種目録]]を返しますが[[変種データ]]は返しません。
目録応答はその要求に最善の特定の変種を返すことを[[サーバー]]が望まないか、
または認められていないときに生成できます。
[[利用者エージェント]]が[[投下内容折衝]]に対応する場合は、
目録応答は最善の変種を選択させてそれを取り出させることになります。
> A list response MUST contain (besides the normal headers required by
HTTP) a TCN header which specifies the "list" response-type, the
Alternates header bound to the negotiable resource, a Vary header and
(unless it was a HEAD request) an entity body which allows the user
to manually select the best variant.
目録応答は ([[HTTP]] で必要とされている通常の頭の他に)
[CODE(HTTP)[[[list]]]] [CODE(ABNF)[response-type]] を指定した
[CODE(HTTP)[[[TCN]]]] 頭と[[折衝可能資源]]に束縛された
[CODE(HTTP)[[[Alternates]]]] 頭、
[CODE(HTTP)[[[Vary]]]] 頭と利用者が手動で最善の変種を選択できる[[実体本体]]を含まなければ'''なりません'''。
> An example of a list response is
[PRE[
HTTP/1.1 300 Multiple Choices
Date: Tue, 11 Jun 1996 20:02:21 GMT
TCN: list
Alternates: {"paper.1" 0.9 {type text/html} {language en}},
{"paper.2" 0.7 {type text/html} {language fr}},
{"paper.3" 1.0 {type application/postscript}
{language en}}
Vary: negotiate, accept, accept-language
ETag: "blah;1234"
Cache-control: max-age=86400
Content-Type: text/html
Content-Length: 227
<h2>Multiple Choices:</h2>
<ul>
<li><a href=paper.1>HTML, English version</a>
<li><a href=paper.2>HTML, French version</a>
<li><a href=paper.3>Postscript, English version</a>
</ul>
]PRE]
> Note: A list response can have any status code, but the 300
(Multiple Choices) code is the most appropriate one for HTTP/1.1
clients. Some existing versions of HTTP/1.0 clients are known to
silently ignore 300 responses, instead of handling them according
to the HTTP/1.0 specification [2]. Servers should therefore be
careful in sending 300 responses to non-negotiating HTTP/1.0 user
agents, and in making these responses cacheable. The 200 (OK)
status code can be used instead.
注意 : 目録応答はどんな[[状態符号]]をも持ち得ますが、
[CODE(HTTP)[[[300]]]] (複数選択肢) 符号が [[HTTP/1.1]] [[クライアント]]には最適です。
既存の版の [[HTTP/1.0]] クライアントの中には [CODE(HTTP)[300]]
応答を HTTP/1.0 仕様書に従って処理せずに黙って無視するものがあることが知られています。
従ってサーバーは折衝を行わない HTTP/1.0 利用者エージェントへの応答に
[CODE(HTTP)[300]] 応答を送ることとその応答を[[キャッシュ可能]]にすることに注意するべきです。
[CODE(HTTP)[[[200]]]] (OK) 状態符号を代わりに使うことが出来ます。
> The Vary header in the response SHOULD ensure correct handling by
plain HTTP/1.1 caching proxies. This header can either be
応答中の [CODE(HTTP)[Vary]] 頭は普通の HTTP/1.1 の[[キャッシュ]]する[[串]]が正しく扱うようにする'''べきです'''。
この頭は
>
- Vary: *
> or a more elaborate header; see section 10.6.1.
とするか、またはより詳細な頭とすることができます。
> Only the origin server may construct list responses. Depending on
the status code, a list response is cacheable unless indicated otherwise.
> According to the HTTP/1.1 specification [1], a user agent which does
not support transparent content negotiation will, when receiving a
list response with the 300 status code, display the entity body
included in the response. If the response contains a Location
header, however, the user agent MAY automatically redirect to this location.
> The handling of list responses by clients supporting transparent
content negotiation is described in sections 11.1 and 13.
]FIG]