libwww-perl-5.813 > 6.03 との差分

HTTP::Status 6.03 と 5.813 の差分

11
22=encoding euc-jp
33
44=head1 NAME
55
66=begin original
77
88HTTP::Status - HTTP Status code processing
99
1010=end original
1111
1212HTTP::Status - HTTP ステータスコード処理
1313
1414=head1 SYNOPSIS
1515
16 use HTTP::Status qw(:constants :is status_message);
16 use HTTP::Status;
1717
18 if ($rc != HTTP_OK) {
18 if ($rc != RC_OK) {
1919 print status_message($rc), "\n";
2020 }
2121
2222 if (is_success($rc)) { ... }
2323 if (is_error($rc)) { ... }
2424 if (is_redirect($rc)) { ... }
2525
2626=head1 DESCRIPTION
2727
2828=begin original
2929
3030I<HTTP::Status> is a library of routines for defining and
3131classifying HTTP status codes for libwww-perl. Status codes are
32used to encode the overall outcome of an HTTP response message. Codes
32used to encode the overall outcome of a HTTP response message. Codes
3333correspond to those defined in RFC 2616 and RFC 2518.
3434
3535=end original
3636
3737I<HTTP::Status> は libwww-perl のための HTTP ステータスコードの定義と
3838分類分け用の関数のライブラリです。
3939ステータスコードは HTTP レスポンスメッセージの全体の結果をコードにするために
4040使われます。
4141コードは RFC2616 と RFC2518 で定義されたものに対応します。
4242
4343=head1 CONSTANTS
4444
4545=begin original
4646
4747The following constant functions can be used as mnemonic status code
48names. None of these are exported by default. Use the C<:constants>
48names:
49tag to import them all.
5049
5150=end original
5251
53以下の定数関数が覚えやすいステータスコード名として使われます
52以下の定数関数が覚えやすいステータスコード名として使われます:
54デフォルトではどれもエクスポートされません。
55これら全てをインポートするには
56C<:constants> タグを使ってください。
5753
58 HTTP_CONTINUE (100)
54 RC_CONTINUE (100)
59 HTTP_SWITCHING_PROTOCOLS (101)
55 RC_SWITCHING_PROTOCOLS (101)
60 HTTP_PROCESSING (102)
56 RC_PROCESSING (102)
6157
62 HTTP_OK (200)
58 RC_OK (200)
63 HTTP_CREATED (201)
59 RC_CREATED (201)
64 HTTP_ACCEPTED (202)
60 RC_ACCEPTED (202)
65 HTTP_NON_AUTHORITATIVE_INFORMATION (203)
61 RC_NON_AUTHORITATIVE_INFORMATION (203)
66 HTTP_NO_CONTENT (204)
62 RC_NO_CONTENT (204)
67 HTTP_RESET_CONTENT (205)
63 RC_RESET_CONTENT (205)
68 HTTP_PARTIAL_CONTENT (206)
64 RC_PARTIAL_CONTENT (206)
69 HTTP_MULTI_STATUS (207)
65 RC_MULTI_STATUS (207)
70 HTTP_ALREADY_REPORTED (208)
7166
72 HTTP_MULTIPLE_CHOICES (300)
67 RC_MULTIPLE_CHOICES (300)
73 HTTP_MOVED_PERMANENTLY (301)
68 RC_MOVED_PERMANENTLY (301)
74 HTTP_FOUND (302)
69 RC_FOUND (302)
75 HTTP_SEE_OTHER (303)
70 RC_SEE_OTHER (303)
76 HTTP_NOT_MODIFIED (304)
71 RC_NOT_MODIFIED (304)
77 HTTP_USE_PROXY (305)
72 RC_USE_PROXY (305)
78 HTTP_TEMPORARY_REDIRECT (307)
73 RC_TEMPORARY_REDIRECT (307)
7974
80 HTTP_BAD_REQUEST (400)
75 RC_BAD_REQUEST (400)
81 HTTP_UNAUTHORIZED (401)
76 RC_UNAUTHORIZED (401)
82 HTTP_PAYMENT_REQUIRED (402)
77 RC_PAYMENT_REQUIRED (402)
83 HTTP_FORBIDDEN (403)
78 RC_FORBIDDEN (403)
84 HTTP_NOT_FOUND (404)
79 RC_NOT_FOUND (404)
85 HTTP_METHOD_NOT_ALLOWED (405)
80 RC_METHOD_NOT_ALLOWED (405)
86 HTTP_NOT_ACCEPTABLE (406)
81 RC_NOT_ACCEPTABLE (406)
87 HTTP_PROXY_AUTHENTICATION_REQUIRED (407)
82 RC_PROXY_AUTHENTICATION_REQUIRED (407)
88 HTTP_REQUEST_TIMEOUT (408)
83 RC_REQUEST_TIMEOUT (408)
89 HTTP_CONFLICT (409)
84 RC_CONFLICT (409)
90 HTTP_GONE (410)
85 RC_GONE (410)
91 HTTP_LENGTH_REQUIRED (411)
86 RC_LENGTH_REQUIRED (411)
92 HTTP_PRECONDITION_FAILED (412)
87 RC_PRECONDITION_FAILED (412)
93 HTTP_REQUEST_ENTITY_TOO_LARGE (413)
88 RC_REQUEST_ENTITY_TOO_LARGE (413)
94 HTTP_REQUEST_URI_TOO_LARGE (414)
89 RC_REQUEST_URI_TOO_LARGE (414)
95 HTTP_UNSUPPORTED_MEDIA_TYPE (415)
90 RC_UNSUPPORTED_MEDIA_TYPE (415)
96 HTTP_REQUEST_RANGE_NOT_SATISFIABLE (416)
91 RC_REQUEST_RANGE_NOT_SATISFIABLE (416)
97 HTTP_EXPECTATION_FAILED (417)
92 RC_EXPECTATION_FAILED (417)
98 HTTP_I_AM_A_TEAPOT (418)
93 RC_UNPROCESSABLE_ENTITY (422)
99 HTTP_UNPROCESSABLE_ENTITY (422)
94 RC_LOCKED (423)
100 HTTP_LOCKED (423)
95 RC_FAILED_DEPENDENCY (424)
101 HTTP_FAILED_DEPENDENCY (424)
96 RC_NO_CODE (425)
102 HTTP_NO_CODE (425)
97 RC_UPGRADE_REQUIRED (426)
103 HTTP_UPGRADE_REQUIRED (426)
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)
10899
109 HTTP_INTERNAL_SERVER_ERROR (500)
100 RC_INTERNAL_SERVER_ERROR (500)
110 HTTP_NOT_IMPLEMENTED (501)
101 RC_NOT_IMPLEMENTED (501)
111 HTTP_BAD_GATEWAY (502)
102 RC_BAD_GATEWAY (502)
112 HTTP_SERVICE_UNAVAILABLE (503)
103 RC_SERVICE_UNAVAILABLE (503)
113 HTTP_GATEWAY_TIMEOUT (504)
104 RC_GATEWAY_TIMEOUT (504)
114 HTTP_HTTP_VERSION_NOT_SUPPORTED (505)
105 RC_HTTP_VERSION_NOT_SUPPORTED (505)
115 HTTP_VARIANT_ALSO_NEGOTIATES (506)
106 RC_VARIANT_ALSO_NEGOTIATES (506)
116 HTTP_INSUFFICIENT_STORAGE (507)
107 RC_INSUFFICIENT_STORAGE (507)
117 HTTP_BANDWIDTH_LIMIT_EXCEEDED (509)
108 RC_BANDWIDTH_LIMIT_EXCEEDED (509)
118 HTTP_NOT_EXTENDED (510)
109 RC_NOT_EXTENDED (510)
119 HTTP_NETWORK_AUTHENTICATION_REQUIRED (511)
120110
121111=head1 FUNCTIONS
122112
123113=begin original
124114
125115The following additional functions are provided. Most of them are
126exported by default. The C<:is> import tag can be used to import all
116exported by default.
127the classification functions.
128117
129118=end original
130119
131120以下の追加の関数が提供されます。
132121ほとんどのものはデフォルトでエクスポートされます。
133全てのクラス分け関数をインポートするために C<:is> インポートタグが使えます。
134122
135123=over 4
136124
137125=item status_message( $code )
138126
139127=begin original
140128
141129The status_message() function will translate status codes to human
142130readable strings. The string is the same as found in the constant
143131names above. If the $code is unknown, then C<undef> is returned.
144132
145133=end original
146134
147135status_message() 関数はステータスコードを人間にも読める文字列に変換します。
148136その文字列は上記の定数名と同じです。
149137$code がわからないと、C<undef> が返されます。
150138
151139=item is_info( $code )
152140
153141=begin original
154142
155143Return TRUE if C<$code> is an I<Informational> status code (1xx). This
156144class of status code indicates a provisional response which can't have
157145any content.
158146
159147=end original
160148
161C<$code> が I<情報的> なステータスコード (1xx) であればを返します。
149C<$code> が I<情報的> なステータスコード (1xx) であれば TRUE を返します。
162150ステータスコードのこのクラスは内容をなにも持つことができない
163151仮のレスポンスであることを示しています。
164152
165153=item is_success( $code )
166154
167155=begin original
168156
169157Return TRUE if C<$code> is a I<Successful> status code (2xx).
170158
171159=end original
172160
173C<$code> が I<正常> なステータスコード (2xx) であればを返します。
161C<$code> が I<正常> なステータスコード (2xx) であれば TRUE を返します。
174162
175163=item is_redirect( $code )
176164
177165=begin original
178166
179167Return TRUE if C<$code> is a I<Redirection> status code (3xx). This class of
180168status code indicates that further action needs to be taken by the
181169user agent in order to fulfill the request.
182170
183171=end original
184172
185173C<$code> が I<リダイレクト> のステータスコード (3xx) であれば
186を返します。
174TRUE を返します。
187175ステータスコードのこのクラスは、そのリクエストを満足するためには、
188176ユーザエージェントがさらに動く必要があることを示します。
189177
190178=item is_error( $code )
191179
192180=begin original
193181
194182Return TRUE if C<$code> is an I<Error> status code (4xx or 5xx). The function
195returns TRUE for both client and server error status codes.
183return TRUE for both client error or a server error status codes.
196184
197185=end original
198186
199C<$code> が I<エラー> のステータスコード (4xx か 5xx) であればを返します。
187C<$code> が I<エラー> のステータスコード (4xx か 5xx) であれば TRUE を返します。
200188この関数はクライアントエラーとサーバーエラーステータスコードの両方で
201を返します。
189TRUE を返します。
202190
203191=item is_client_error( $code )
204192
205193=begin original
206194
207Return TRUE if C<$code> is a I<Client Error> status code (4xx). This class
195Return TRUE if C<$code> is an I<Client Error> status code (4xx). This class
208196of status code is intended for cases in which the client seems to have
209197erred.
210198
211199=end original
212200
213201C<$code> が I<クライアントエラー> のステータスコード (4xx) であれば
214を返します。
202TRUEを返します。
215203ステータスコードのこのクラスは、クライアントがエラーになっているように
216204見える場合を考えています。
217205
218206=begin original
219207
220208This function is B<not> exported by default.
221209
222210=end original
223211
224212この関数はデフォルトではエクスポートされません。
225213
226214=item is_server_error( $code )
227215
228216=begin original
229217
230Return TRUE if C<$code> is a I<Server Error> status code (5xx). This class
218Return TRUE if C<$code> is an I<Server Error> status code (5xx). This class
231219of status codes is intended for cases in which the server is aware
232220that it has erred or is incapable of performing the request.
233221
234222=end original
235223
236224C<$code> が I<サーバーエラー> のステータスコード (5xx) であれば
237を返します。
225TRUE を返します。
238226ステータスコードのこのクラスは、サーバがそれがエラーなったことあるいは、
239227そのリクエストを実行できないことに気がついた場合を考えています。
240228
241229=begin original
242230
243231This function is B<not> exported by default.
244232
245233=end original
246234
247235この関数はデフォルトではエクスポートされません。
248236
249237=back
250238
251239=head1 BUGS
252240
253241=begin original
254242
255For legacy reasons all the C<HTTP_> constants are exported by default
243Wished @EXPORT_OK had been used instead of @EXPORT in the beginning.
256with the prefix C<RC_>. It's recommended to use explicit imports and
244Now too much is exported by default.
257the C<:constants> tag instead of relying on this.
258245
259246=end original
260247
261歴史的な理由より、全ての C<HTTP_> 定数はデフォルトでは C<RC_> 接頭辞付きで
248始め@EXPORT の代りに期待された @EXPORT_OK が使われています。
262エクスポートされています。
249デフォルトであまりにも多くがエクスポートされます。
263これに頼らずに、明示的なインポートと C<:constants> タグを使うことを
264勧めます。
265250
266251=begin meta
267252
268Translate: Hippo2000 <GCD00051@nifty.ne.jp> (5.48)
253Translated: Hippo2000 <GCD00051@nifty.ne.jp> (5.48)
269Update: SHIRAKATA Kentaro <argrath@ub32.org> (5.813-)
254Updated: Kentaro SHIRAKATA <argrath@ub32.org> (5.813)
270Status: completed
271255
272256=end meta