libwww-perl-5.813 >
6.03
との差分
HTTP::Status 6.03 と 5.813 の差分
1 | 1 | |
2 | 2 | =encoding euc-jp |
3 | 3 | |
4 | 4 | =head1 NAME |
5 | 5 | |
6 | 6 | =begin original |
7 | 7 | |
8 | 8 | HTTP::Status - HTTP Status code processing |
9 | 9 | |
10 | 10 | =end original |
11 | 11 | |
12 | 12 | HTTP::Status - HTTP ステータスコード処理 |
13 | 13 | |
14 | 14 | =head1 SYNOPSIS |
15 | 15 | |
16 | use HTTP::Status | |
16 | use HTTP::Status; | |
17 | 17 | |
18 | if ($rc != | |
18 | if ($rc != RC_OK) { | |
19 | 19 | print status_message($rc), "\n"; |
20 | 20 | } |
21 | 21 | |
22 | 22 | if (is_success($rc)) { ... } |
23 | 23 | if (is_error($rc)) { ... } |
24 | 24 | if (is_redirect($rc)) { ... } |
25 | 25 | |
26 | 26 | =head1 DESCRIPTION |
27 | 27 | |
28 | 28 | =begin original |
29 | 29 | |
30 | 30 | I<HTTP::Status> is a library of routines for defining and |
31 | 31 | classifying HTTP status codes for libwww-perl. Status codes are |
32 | used to encode the overall outcome of a | |
32 | used to encode the overall outcome of a HTTP response message. Codes | |
33 | 33 | correspond to those defined in RFC 2616 and RFC 2518. |
34 | 34 | |
35 | 35 | =end original |
36 | 36 | |
37 | 37 | I<HTTP::Status> は libwww-perl のための HTTP ステータスコードの定義と |
38 | 38 | 分類分け用の関数のライブラリです。 |
39 | 39 | ステータスコードは HTTP レスポンスメッセージの全体の結果をコードにするために |
40 | 40 | 使われます。 |
41 | 41 | コードは RFC2616 と RFC2518 で定義されたものに対応します。 |
42 | 42 | |
43 | 43 | =head1 CONSTANTS |
44 | 44 | |
45 | 45 | =begin original |
46 | 46 | |
47 | 47 | The following constant functions can be used as mnemonic status code |
48 | names | |
48 | names: | |
49 | tag to import them all. | |
50 | 49 | |
51 | 50 | =end original |
52 | 51 | |
53 | 以下の定数関数が覚えやすいステータスコード名として使われます | |
52 | 以下の定数関数が覚えやすいステータスコード名として使われます: | |
54 | デフォルトではどれもエクスポートされません。 | |
55 | これら全てをインポートするには | |
56 | C<:constants> タグを使ってください。 | |
57 | 53 | |
58 | | |
54 | RC_CONTINUE (100) | |
59 | | |
55 | RC_SWITCHING_PROTOCOLS (101) | |
60 | | |
56 | RC_PROCESSING (102) | |
61 | 57 | |
62 | | |
58 | RC_OK (200) | |
63 | | |
59 | RC_CREATED (201) | |
64 | | |
60 | RC_ACCEPTED (202) | |
65 | | |
61 | RC_NON_AUTHORITATIVE_INFORMATION (203) | |
66 | | |
62 | RC_NO_CONTENT (204) | |
67 | | |
63 | RC_RESET_CONTENT (205) | |
68 | | |
64 | RC_PARTIAL_CONTENT (206) | |
69 | | |
65 | RC_MULTI_STATUS (207) | |
70 | HTTP_ALREADY_REPORTED (208) | |
71 | 66 | |
72 | | |
67 | RC_MULTIPLE_CHOICES (300) | |
73 | | |
68 | RC_MOVED_PERMANENTLY (301) | |
74 | | |
69 | RC_FOUND (302) | |
75 | | |
70 | RC_SEE_OTHER (303) | |
76 | | |
71 | RC_NOT_MODIFIED (304) | |
77 | | |
72 | RC_USE_PROXY (305) | |
78 | | |
73 | RC_TEMPORARY_REDIRECT (307) | |
79 | 74 | |
80 | | |
75 | RC_BAD_REQUEST (400) | |
81 | | |
76 | RC_UNAUTHORIZED (401) | |
82 | | |
77 | RC_PAYMENT_REQUIRED (402) | |
83 | | |
78 | RC_FORBIDDEN (403) | |
84 | | |
79 | RC_NOT_FOUND (404) | |
85 | | |
80 | RC_METHOD_NOT_ALLOWED (405) | |
86 | | |
81 | RC_NOT_ACCEPTABLE (406) | |
87 | | |
82 | RC_PROXY_AUTHENTICATION_REQUIRED (407) | |
88 | | |
83 | RC_REQUEST_TIMEOUT (408) | |
89 | | |
84 | RC_CONFLICT (409) | |
90 | | |
85 | RC_GONE (410) | |
91 | | |
86 | RC_LENGTH_REQUIRED (411) | |
92 | | |
87 | RC_PRECONDITION_FAILED (412) | |
93 | | |
88 | RC_REQUEST_ENTITY_TOO_LARGE (413) | |
94 | | |
89 | RC_REQUEST_URI_TOO_LARGE (414) | |
95 | | |
90 | RC_UNSUPPORTED_MEDIA_TYPE (415) | |
96 | | |
91 | RC_REQUEST_RANGE_NOT_SATISFIABLE (416) | |
97 | | |
92 | RC_EXPECTATION_FAILED (417) | |
98 | | |
93 | RC_UNPROCESSABLE_ENTITY (422) | |
99 | | |
94 | RC_LOCKED (423) | |
100 | | |
95 | RC_FAILED_DEPENDENCY (424) | |
101 | | |
96 | RC_NO_CODE (425) | |
102 | | |
97 | RC_UPGRADE_REQUIRED (426) | |
103 | | |
98 | RC_RETRY_WITH (449) | |
104 | HTTP_PRECONDITION_REQUIRED (428) | |
105 | HTTP_TOO_MANY_REQUESTS (429) | |
106 | HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE (431) | |
107 | HTTP_RETRY_WITH (449) | |
108 | 99 | |
109 | | |
100 | RC_INTERNAL_SERVER_ERROR (500) | |
110 | | |
101 | RC_NOT_IMPLEMENTED (501) | |
111 | | |
102 | RC_BAD_GATEWAY (502) | |
112 | | |
103 | RC_SERVICE_UNAVAILABLE (503) | |
113 | | |
104 | RC_GATEWAY_TIMEOUT (504) | |
114 | | |
105 | RC_HTTP_VERSION_NOT_SUPPORTED (505) | |
115 | | |
106 | RC_VARIANT_ALSO_NEGOTIATES (506) | |
116 | | |
107 | RC_INSUFFICIENT_STORAGE (507) | |
117 | | |
108 | RC_BANDWIDTH_LIMIT_EXCEEDED (509) | |
118 | | |
109 | RC_NOT_EXTENDED (510) | |
119 | HTTP_NETWORK_AUTHENTICATION_REQUIRED (511) | |
120 | 110 | |
121 | 111 | =head1 FUNCTIONS |
122 | 112 | |
123 | 113 | =begin original |
124 | 114 | |
125 | 115 | The following additional functions are provided. Most of them are |
126 | exported by default. | |
116 | exported by default. | |
127 | the classification functions. | |
128 | 117 | |
129 | 118 | =end original |
130 | 119 | |
131 | 120 | 以下の追加の関数が提供されます。 |
132 | 121 | ほとんどのものはデフォルトでエクスポートされます。 |
133 | 全てのクラス分け関数をインポートするために C<:is> インポートタグが使えます。 | |
134 | 122 | |
135 | 123 | =over 4 |
136 | 124 | |
137 | 125 | =item status_message( $code ) |
138 | 126 | |
139 | 127 | =begin original |
140 | 128 | |
141 | 129 | The status_message() function will translate status codes to human |
142 | 130 | readable strings. The string is the same as found in the constant |
143 | 131 | names above. If the $code is unknown, then C<undef> is returned. |
144 | 132 | |
145 | 133 | =end original |
146 | 134 | |
147 | 135 | status_message() 関数はステータスコードを人間にも読める文字列に変換します。 |
148 | 136 | その文字列は上記の定数名と同じです。 |
149 | 137 | $code がわからないと、C<undef> が返されます。 |
150 | 138 | |
151 | 139 | =item is_info( $code ) |
152 | 140 | |
153 | 141 | =begin original |
154 | 142 | |
155 | 143 | Return TRUE if C<$code> is an I<Informational> status code (1xx). This |
156 | 144 | class of status code indicates a provisional response which can't have |
157 | 145 | any content. |
158 | 146 | |
159 | 147 | =end original |
160 | 148 | |
161 | C<$code> が I<情報的> なステータスコード (1xx) であれば | |
149 | C<$code> が I<情報的> なステータスコード (1xx) であれば TRUE を返します。 | |
162 | 150 | ステータスコードのこのクラスは内容をなにも持つことができない |
163 | 151 | 仮のレスポンスであることを示しています。 |
164 | 152 | |
165 | 153 | =item is_success( $code ) |
166 | 154 | |
167 | 155 | =begin original |
168 | 156 | |
169 | 157 | Return TRUE if C<$code> is a I<Successful> status code (2xx). |
170 | 158 | |
171 | 159 | =end original |
172 | 160 | |
173 | C<$code> が I<正常> なステータスコード (2xx) であれば | |
161 | C<$code> が I<正常> なステータスコード (2xx) であれば TRUE を返します。 | |
174 | 162 | |
175 | 163 | =item is_redirect( $code ) |
176 | 164 | |
177 | 165 | =begin original |
178 | 166 | |
179 | 167 | Return TRUE if C<$code> is a I<Redirection> status code (3xx). This class of |
180 | 168 | status code indicates that further action needs to be taken by the |
181 | 169 | user agent in order to fulfill the request. |
182 | 170 | |
183 | 171 | =end original |
184 | 172 | |
185 | 173 | C<$code> が I<リダイレクト> のステータスコード (3xx) であれば |
186 | ||
174 | TRUE を返します。 | |
187 | 175 | ステータスコードのこのクラスは、そのリクエストを満足するためには、 |
188 | 176 | ユーザエージェントがさらに動く必要があることを示します。 |
189 | 177 | |
190 | 178 | =item is_error( $code ) |
191 | 179 | |
192 | 180 | =begin original |
193 | 181 | |
194 | 182 | Return TRUE if C<$code> is an I<Error> status code (4xx or 5xx). The function |
195 | return | |
183 | return TRUE for both client error or a server error status codes. | |
196 | 184 | |
197 | 185 | =end original |
198 | 186 | |
199 | C<$code> が I<エラー> のステータスコード (4xx か 5xx) であれば | |
187 | C<$code> が I<エラー> のステータスコード (4xx か 5xx) であれば TRUE を返します。 | |
200 | 188 | この関数はクライアントエラーとサーバーエラーステータスコードの両方で |
201 | ||
189 | TRUE を返します。 | |
202 | 190 | |
203 | 191 | =item is_client_error( $code ) |
204 | 192 | |
205 | 193 | =begin original |
206 | 194 | |
207 | Return TRUE if C<$code> is a I<Client Error> status code (4xx). This class | |
195 | Return TRUE if C<$code> is an I<Client Error> status code (4xx). This class | |
208 | 196 | of status code is intended for cases in which the client seems to have |
209 | 197 | erred. |
210 | 198 | |
211 | 199 | =end original |
212 | 200 | |
213 | 201 | C<$code> が I<クライアントエラー> のステータスコード (4xx) であれば |
214 | ||
202 | TRUEを返します。 | |
215 | 203 | ステータスコードのこのクラスは、クライアントがエラーになっているように |
216 | 204 | 見える場合を考えています。 |
217 | 205 | |
218 | 206 | =begin original |
219 | 207 | |
220 | 208 | This function is B<not> exported by default. |
221 | 209 | |
222 | 210 | =end original |
223 | 211 | |
224 | 212 | この関数はデフォルトではエクスポートされません。 |
225 | 213 | |
226 | 214 | =item is_server_error( $code ) |
227 | 215 | |
228 | 216 | =begin original |
229 | 217 | |
230 | Return TRUE if C<$code> is a I<Server Error> status code (5xx). This class | |
218 | Return TRUE if C<$code> is an I<Server Error> status code (5xx). This class | |
231 | 219 | of status codes is intended for cases in which the server is aware |
232 | 220 | that it has erred or is incapable of performing the request. |
233 | 221 | |
234 | 222 | =end original |
235 | 223 | |
236 | 224 | C<$code> が I<サーバーエラー> のステータスコード (5xx) であれば |
237 | ||
225 | TRUE を返します。 | |
238 | 226 | ステータスコードのこのクラスは、サーバがそれがエラーなったことあるいは、 |
239 | 227 | そのリクエストを実行できないことに気がついた場合を考えています。 |
240 | 228 | |
241 | 229 | =begin original |
242 | 230 | |
243 | 231 | This function is B<not> exported by default. |
244 | 232 | |
245 | 233 | =end original |
246 | 234 | |
247 | 235 | この関数はデフォルトではエクスポートされません。 |
248 | 236 | |
249 | 237 | =back |
250 | 238 | |
251 | 239 | =head1 BUGS |
252 | 240 | |
253 | 241 | =begin original |
254 | 242 | |
255 | ||
243 | Wished @EXPORT_OK had been used instead of @EXPORT in the beginning. | |
256 | w | |
244 | Now too much is exported by default. | |
257 | the C<:constants> tag instead of relying on this. | |
258 | 245 | |
259 | 246 | =end original |
260 | 247 | |
261 | ||
248 | 始めに @EXPORT の代りに期待された @EXPORT_OK が使われています。 | |
262 | エクスポートされ | |
249 | デフォルトであまりにも多くがエクスポートされます。 | |
263 | これに頼らずに、明示的なインポートと C<:constants> タグを使うことを | |
264 | 勧めます。 | |
265 | 250 | |
266 | 251 | =begin meta |
267 | 252 | |
268 | Translate: Hippo2000 <GCD00051@nifty.ne.jp> (5.48) | |
253 | Translated: Hippo2000 <GCD00051@nifty.ne.jp> (5.48) | |
269 | Update: SHIRAKATA | |
254 | Updated: Kentaro SHIRAKATA <argrath@ub32.org> (5.813) | |
270 | Status: completed | |
271 | 255 | |
272 | 256 | =end meta |