Klaus Demo nginx / 5a4344f
add HTTP response codes Igor Sysoev 14 years ago
1 changed file(s) with 65 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1010 our @EXPORT = qw(
1111 OK
1212 DECLINED
13
1314 HTTP_OK
15 HTTP_CREATED
16 HTTP_NO_CONTENT
17 HTTP_PARTIAL_CONTENT
18
19 HTTP_MOVED_PERMANENTLY
20 HTTP_MOVED_TEMPORARILY
1421 HTTP_REDIRECT
22 HTTP_NOT_MODIFIED
23
24 HTTP_BAD_REQUEST
25 HTTP_UNAUTHORIZED
26 HTTP_PAYMENT_REQUIRED
27 HTTP_FORBIDDEN
1528 HTTP_NOT_FOUND
29 HTTP_NOT_ALLOWED
30 HTTP_NOT_ACCEPTABLE
31 HTTP_REQUEST_TIME_OUT
32 HTTP_CONFLICT
33 HTTP_GONE
34 HTTP_LENGTH_REQUIRED
35 HTTP_REQUEST_ENTITY_TOO_LARGE
36 HTTP_REQUEST_URI_TOO_LARGE
37 HTTP_UNSUPPORTED_MEDIA_TYPE
38 HTTP_RANGE_NOT_SATISFIABLE
39
40 HTTP_INTERNAL_SERVER_ERROR
1641 HTTP_SERVER_ERROR
42 HTTP_NOT_IMPLEMENTED
43 HTTP_BAD_GATEWAY
44 HTTP_SERVICE_UNAVAILABLE
45 HTTP_GATEWAY_TIME_OUT
46 HTTP_INSUFFICIENT_STORAGE
1747 );
1848
1949 our $VERSION = '0.5.3';
2353
2454 # Preloaded methods go here.
2555
26 use constant OK => 0;
27 use constant DECLINED => -5;
56 use constant OK => 0;
57 use constant DECLINED => -5;
2858
29 use constant HTTP_OK => 200;
30 use constant HTTP_REDIRECT => 302;
31 use constant HTTP_NOT_FOUND => 404;
32 use constant HTTP_SERVER_ERROR => 500;
59 use constant HTTP_OK => 200;
60 use constant HTTP_CREATED => 201;
61 use constant HTTP_NO_CONTENT => 204;
62 use constant HTTP_PARTIAL_CONTENT => 206;
63
64 use constant HTTP_MOVED_PERMANENTLY => 301;
65 use constant HTTP_MOVED_TEMPORARILY => 302;
66 use constant HTTP_REDIRECT => 302;
67 use constant HTTP_NOT_MODIFIED => 304;
68
69 use constant HTTP_BAD_REQUEST => 400;
70 use constant HTTP_UNAUTHORIZED => 401;
71 use constant HTTP_PAYMENT_REQUIRED => 402;
72 use constant HTTP_FORBIDDEN => 403;
73 use constant HTTP_NOT_FOUND => 404;
74 use constant HTTP_NOT_ALLOWED => 405;
75 use constant HTTP_NOT_ACCEPTABLE => 406;
76 use constant HTTP_REQUEST_TIME_OUT => 408;
77 use constant HTTP_CONFLICT => 409;
78 use constant HTTP_GONE => 410;
79 use constant HTTP_LENGTH_REQUIRED => 411;
80 use constant HTTP_REQUEST_ENTITY_TOO_LARGE => 413;
81 use constant HTTP_REQUEST_URI_TOO_LARGE => 414;
82 use constant HTTP_UNSUPPORTED_MEDIA_TYPE => 415;
83 use constant HTTP_RANGE_NOT_SATISFIABLE => 416;
84
85 use constant HTTP_INTERNAL_SERVER_ERROR => 500;
86 use constant HTTP_SERVER_ERROR => 500;
87 use constant HTTP_NOT_IMPLEMENTED => 501;
88 use constant HTTP_BAD_GATEWAY => 502;
89 use constant HTTP_SERVICE_UNAVAILABLE => 503;
90 use constant HTTP_GATEWAY_TIME_OUT => 504;
91 use constant HTTP_INSUFFICIENT_STORAGE => 507;
3392
3493
3594 1;