/
425.txt
68 lines (52 loc) · 3.39 KB
/
425.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
[1] [[HTTP]] において[[メソッド]]や[[要求]]が[DFN[[RUBYB[[[安全]]]@en[safe]]]]であるとは、
[[副作用]]が無い (少なくても[[利用者]]は求めていない) ことを表します。
* 仕様書
[REFS[
- [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.1>
]REFS]
* 安全なメソッド
[FIG(list)[
- [3] [CODE(HTTP)@en[[[GET]]]]
- [4] [CODE(HTTP)@en[[[HEAD]]]]
]FIG]
* 歴史
[FIG(quote)[
[FIGCAPTION[
[2] RFC 2068・2616 (HTTP/1.1) 9.1 Safe and Idempotent Methods
]FIGCAPTION]
* RFC 1945 (HTTP/1.0) 12.2; RFC 2068・2616 (HTTP/1.1) 9.1.1 Safe Methods
> [DEL[[DEL[The writers of client software]] [INS[Implementers]]]] [INS[[INS[{2616}]] Implementors]] should be aware that the software represents the user in
their interactions over the Internet, and should be careful to allow
the user to be aware of any actions they [DEL[may]] [INS[might]] take which may have an
unexpected significance to themselves or others.
実装者は、ソフトウェアがインターネット上の相互作用で利用者を表現することを意識し、
自身や他者に意図せぬ意味を持つかもしれない動作を取ろうとする時には利用者がそのことに気づけるように注意するべきです。
> In particular, the convention has been established that the GET and
HEAD methods [DEL[should never]] [INS[SHOULD NOT]] have the significance of taking an action
other than retrieval. These methods [DEL[should]] [INS[ought to]] be considered [DEL["safe."]] [INS["safe".]]
This allows user agents to represent other methods, such as POST, [INS[[INS[{2068,2616}]] PUT and DELETE,]] in a special way, so that the user is made aware of the
fact that a possibly unsafe action is being requested.
特に、 [CODE(HTTP)[[[GET]]]] 方式や [CODE(HTTP)[[[HEAD]]]]
方式が取り出し (retrieval) 以外の動作を取る意味を持つ'''べきではない'''という慣習が確立しています。
これらの方式は「安全」であると考えられるべきです。
これによって、利用者は他の方式、例えば [CODE(HTTP)[[[POST]]]]
や [CODE(HTTP)[[[PUT]]]] や [CODE(HTTP)[[[DELETE]]]]
を、特別な用途で表明することができ、
よって利用者に非安全かもしれない動作が要求されようとしていることを気づかせることができます。
> Naturally, it is not possible to ensure that the server does not
generate side-effects as a result of performing a GET request; in
fact, some dynamic resources consider that a feature. The important
distinction here is that the user did not request the side-effects,
so therefore cannot be held accountable for them.
当然、サーバーが [CODE(HTTP)[GET]] 要求を行うことで副作用を起こさないことを保証はできません。
実際、動的資源の中にはそれを機能としています。
ここでの重要な違いは、利用者は副作用を要求していないので、
従ってそれについての責任を負えないことです。
[INS[
注: 注記のない変更点は、 RFC 2068→RFC 2616 での修正。
]INS]
* RFC 2068・2616 (HTTP/1.1) 9.1.2 Idempotent Methods
→[CODE(WikiPage)[[[冪等]]]]
]FIG]
* 関連
[5] 類似した概念に[[冪等]]があります。