Add built local::lib
[catagits/Gitalist.git] / local-lib5 / man / man3 / HTTP::Status.3pm
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  | will give a
29 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
32 .tr \(*W-|\(bv\*(Tr
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
65 .hy 0
66 .if n .na
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "HTTP::Status 3"
132 .TH HTTP::Status 3 "2009-06-13" "perl v5.8.7" "User Contributed Perl Documentation"
133 .SH "NAME"
134 HTTP::Status \- HTTP Status code processing
135 .SH "SYNOPSIS"
136 .IX Header "SYNOPSIS"
137 .Vb 1
138 \& use HTTP::Status qw(:constants :is status_message);
139 .Ve
140 .PP
141 .Vb 3
142 \& if ($rc != HTTP_OK) {
143 \&     print status_message($rc), "\en";
144 \& }
145 .Ve
146 .PP
147 .Vb 3
148 \& if (is_success($rc)) { ... }
149 \& if (is_error($rc)) { ... }
150 \& if (is_redirect($rc)) { ... }
151 .Ve
152 .SH "DESCRIPTION"
153 .IX Header "DESCRIPTION"
154 \&\fIHTTP::Status\fR is a library of routines for defining and
155 classifying \s-1HTTP\s0 status codes for libwww\-perl.  Status codes are
156 used to encode the overall outcome of a \s-1HTTP\s0 response message.  Codes
157 correspond to those defined in \s-1RFC\s0 2616 and \s-1RFC\s0 2518.
158 .SH "CONSTANTS"
159 .IX Header "CONSTANTS"
160 The following constant functions can be used as mnemonic status code
161 names.  None of these are exported by default.  Use the \f(CW\*(C`:constants\*(C'\fR
162 tag to import them all.
163 .PP
164 .Vb 3
165 \&   HTTP_CONTINUE                        (100)
166 \&   HTTP_SWITCHING_PROTOCOLS             (101)
167 \&   HTTP_PROCESSING                      (102)
168 .Ve
169 .PP
170 .Vb 8
171 \&   HTTP_OK                              (200)
172 \&   HTTP_CREATED                         (201)
173 \&   HTTP_ACCEPTED                        (202)
174 \&   HTTP_NON_AUTHORITATIVE_INFORMATION   (203)
175 \&   HTTP_NO_CONTENT                      (204)
176 \&   HTTP_RESET_CONTENT                   (205)
177 \&   HTTP_PARTIAL_CONTENT                 (206)
178 \&   HTTP_MULTI_STATUS                    (207)
179 .Ve
180 .PP
181 .Vb 7
182 \&   HTTP_MULTIPLE_CHOICES                (300)
183 \&   HTTP_MOVED_PERMANENTLY               (301)
184 \&   HTTP_FOUND                           (302)
185 \&   HTTP_SEE_OTHER                       (303)
186 \&   HTTP_NOT_MODIFIED                    (304)
187 \&   HTTP_USE_PROXY                       (305)
188 \&   HTTP_TEMPORARY_REDIRECT              (307)
189 .Ve
190 .PP
191 .Vb 24
192 \&   HTTP_BAD_REQUEST                     (400)
193 \&   HTTP_UNAUTHORIZED                    (401)
194 \&   HTTP_PAYMENT_REQUIRED                (402)
195 \&   HTTP_FORBIDDEN                       (403)
196 \&   HTTP_NOT_FOUND                       (404)
197 \&   HTTP_METHOD_NOT_ALLOWED              (405)
198 \&   HTTP_NOT_ACCEPTABLE                  (406)
199 \&   HTTP_PROXY_AUTHENTICATION_REQUIRED   (407)
200 \&   HTTP_REQUEST_TIMEOUT                 (408)
201 \&   HTTP_CONFLICT                        (409)
202 \&   HTTP_GONE                            (410)
203 \&   HTTP_LENGTH_REQUIRED                 (411)
204 \&   HTTP_PRECONDITION_FAILED             (412)
205 \&   HTTP_REQUEST_ENTITY_TOO_LARGE        (413)
206 \&   HTTP_REQUEST_URI_TOO_LARGE           (414)
207 \&   HTTP_UNSUPPORTED_MEDIA_TYPE          (415)
208 \&   HTTP_REQUEST_RANGE_NOT_SATISFIABLE   (416)
209 \&   HTTP_EXPECTATION_FAILED              (417)
210 \&   HTTP_UNPROCESSABLE_ENTITY            (422)
211 \&   HTTP_LOCKED                          (423)
212 \&   HTTP_FAILED_DEPENDENCY               (424)
213 \&   HTTP_NO_CODE                         (425)
214 \&   HTTP_UPGRADE_REQUIRED                (426)
215 \&   HTTP_RETRY_WITH                      (449)
216 .Ve
217 .PP
218 .Vb 10
219 \&   HTTP_INTERNAL_SERVER_ERROR           (500)
220 \&   HTTP_NOT_IMPLEMENTED                 (501)
221 \&   HTTP_BAD_GATEWAY                     (502)
222 \&   HTTP_SERVICE_UNAVAILABLE             (503)
223 \&   HTTP_GATEWAY_TIMEOUT                 (504)
224 \&   HTTP_HTTP_VERSION_NOT_SUPPORTED      (505)
225 \&   HTTP_VARIANT_ALSO_NEGOTIATES         (506)
226 \&   HTTP_INSUFFICIENT_STORAGE            (507)
227 \&   HTTP_BANDWIDTH_LIMIT_EXCEEDED        (509)
228 \&   HTTP_NOT_EXTENDED                    (510)
229 .Ve
230 .SH "FUNCTIONS"
231 .IX Header "FUNCTIONS"
232 The following additional functions are provided.  Most of them are
233 exported by default.  The \f(CW\*(C`:is\*(C'\fR import tag can be used to import all
234 the classification functions.
235 .ie n .IP "status_message( $code )" 4
236 .el .IP "status_message( \f(CW$code\fR )" 4
237 .IX Item "status_message( $code )"
238 The \fIstatus_message()\fR function will translate status codes to human
239 readable strings. The string is the same as found in the constant
240 names above.  If the \f(CW$code\fR is unknown, then \f(CW\*(C`undef\*(C'\fR is returned.
241 .ie n .IP "is_info( $code )" 4
242 .el .IP "is_info( \f(CW$code\fR )" 4
243 .IX Item "is_info( $code )"
244 Return \s-1TRUE\s0 if \f(CW$code\fR is an \fIInformational\fR status code (1xx).  This
245 class of status code indicates a provisional response which can't have
246 any content.
247 .ie n .IP "is_success( $code )" 4
248 .el .IP "is_success( \f(CW$code\fR )" 4
249 .IX Item "is_success( $code )"
250 Return \s-1TRUE\s0 if \f(CW$code\fR is a \fISuccessful\fR status code (2xx).
251 .ie n .IP "is_redirect( $code )" 4
252 .el .IP "is_redirect( \f(CW$code\fR )" 4
253 .IX Item "is_redirect( $code )"
254 Return \s-1TRUE\s0 if \f(CW$code\fR is a \fIRedirection\fR status code (3xx). This class of
255 status code indicates that further action needs to be taken by the
256 user agent in order to fulfill the request.
257 .ie n .IP "is_error( $code )" 4
258 .el .IP "is_error( \f(CW$code\fR )" 4
259 .IX Item "is_error( $code )"
260 Return \s-1TRUE\s0 if \f(CW$code\fR is an \fIError\fR status code (4xx or 5xx).  The function
261 return \s-1TRUE\s0 for both client error or a server error status codes.
262 .ie n .IP "is_client_error( $code )" 4
263 .el .IP "is_client_error( \f(CW$code\fR )" 4
264 .IX Item "is_client_error( $code )"
265 Return \s-1TRUE\s0 if \f(CW$code\fR is an \fIClient Error\fR status code (4xx). This class
266 of status code is intended for cases in which the client seems to have
267 erred.
268 .Sp
269 This function is \fBnot\fR exported by default.
270 .ie n .IP "is_server_error( $code )" 4
271 .el .IP "is_server_error( \f(CW$code\fR )" 4
272 .IX Item "is_server_error( $code )"
273 Return \s-1TRUE\s0 if \f(CW$code\fR is an \fIServer Error\fR status code (5xx). This class
274 of status codes is intended for cases in which the server is aware
275 that it has erred or is incapable of performing the request.
276 .Sp
277 This function is \fBnot\fR exported by default.
278 .SH "BUGS"
279 .IX Header "BUGS"
280 For legacy reasons all the \f(CW\*(C`HTTP_\*(C'\fR constants are exported by default
281 with the prefix \f(CW\*(C`RC_\*(C'\fR.  It's recommended to use explict imports and
282 the \f(CW\*(C`:constants\*(C'\fR tag instead of relying on this.