-
Notifications
You must be signed in to change notification settings - Fork 4
/
884.txt
78 lines (60 loc) · 4.82 KB
/
884.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
[519] [DFN[[CODE(HTTP)[[[409]]]]]] ([DFN[[[Conflict]]]])
は、[[対象資源]]の現在の状態と[[要求]]との不整合によって[[要求]]を処理できなかったことを示す[[状態符号]]です
[SRC[>>514]]。
[EG[
[520] 例えば、編集フォームが含まれるページを表示してからそのフォームを[[提出]]するまでの間に[[提出]]先の[[資源]]が変更されている場合、
[[鯖]]は [CODE(HTTP)[[[409]]]] を返すことができます。
]EG]
* 仕様書
[REFS[
- [514] '''[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#section-6.5.8>'''
- [507] [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.4>
- [1] [CITE@en[RFC 4918 - HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)]] ([TIME[2014-09-21 17:04:59 +09:00]] 版) <http://tools.ietf.org/html/rfc4918#section-14.5>
- [3] [CITE@en[RFC 4918 - HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)]] ([TIME[2014-09-21 17:04:59 +09:00]] 版) <http://tools.ietf.org/html/rfc4918#section-16>
]REFS]
* 意味
[516] [CODE(HTTP)[[[409]]]] は、[[対象資源]]の現在の状態との衝突のために[[要求]]が完了できなかったことを示します
[SRC[>>514]]。
[517] [CODE(HTTP)[[[409]]]] は、[[利用者]]が衝突を解決して[[要求]]を再提出できるかもしれない場合に使います
[SRC[>>514, >>3]]。
;; [4] そうでない場合は [CODE(HTTP)[[[403]]]] を使えます。
* 構文
[518] [[鯖]]は、[[利用者]]が衝突の原因を認識できる十分な情報を [[payload]]
に含める[['''べきです''']] [SRC[>>514]]。
[2] [[payload body]] には [CODE(URI)@en[[[DAV:]]]] [[名前空間]]の
[CODE(XMLe)@en[[[error]]]] [[要素]]を使うことができます [SRC[>>1]]。
* 文脈
[513] [[起源鯖]]は、 [CODE(HTTP)@en[[[PUT]]]] の[[表現]]が当該[[対象資源]]に関する変更できない[[鯖]]の制約を
(あれば) 満たしているか検証する[['''べきです''']]。満たしていない時には、
満たすように変形を加えるか、適切な説明とともにエラーを返す[['''べきです''']]。
[[状態符号]]としては、 [CODE(HTTP)[[[409]]]] を使うことができます。 [SRC[>>507]]
* 歴史
[FIG(quote)[
[FIGCAPTION[
[515] RFC 2068 & 2616 (HTTP/1.1) 10.4.10 409 Conflict
]FIGCAPTION]
> The request could not be completed due to a conflict with the current
state of the resource. This code is only allowed in situations where
it is expected that the user might be able to resolve the conflict
and resubmit the request. The response body SHOULD include enough
information for the user to recognize the source of the conflict.
Ideally, the response entity would include enough information for the
user or user agent to fix the problem; however, that [DEL[may]] [INS[might]] not be
possible and is not required.
資源の現在の状態と衝突したために、要求は完了できませんでした。
この符号は、利用者が衝突を解決可能で要求を再提出できそうに思われる場合にのみ認められます。
応答本体は、利用者が衝突の原因を認識できる十分な情報を含んでいる'''べきです'''。
理想的には、応答実体は利用者又は利用者エージェントが問題を修正するのに十分な情報を含んでいるのがよいでしょうが、それは可能ではないかもしれませんし、必須ではありません。
> Conflicts are most likely to occur in response to a PUT request. [INS[For example, if]] [DEL[If]] versioning [DEL[is]] [INS[were]] being used and the entity being PUT includes changes to
a resource which conflict with those made by an earlier (third-party)
request, the server [DEL[MAY]] [INS[might]] use the 409 response to indicate that it
can't complete the request. In this case, the response entity [DEL[SHOULD]] [INS[would likely]]
contain a list of the differences between the two versions in a
format defined by the response Content-Type.
衝突は [CODE(HTTP)[[[PUT]]]] 要求への応答で最も起こりそうです。
例えば、版管理が行われており、 [CODE(HTTP)[PUT]] している実体が以前の (第3者による)
要求による変更と衝突する変更を含んでいるとしたら、
サーバーは [CODE(HTTP)[409]] 応答を使って要求が完了できなかったことを示すことができるでしょう。
この場合には、応答実体は応答 [CODE(HTTP)[[[Content-Type]]]]
で定義された書式によって、2つの版の差分の一覧を含めることとなるでしょう。
]FIG]