NAME

HTTP::Status - HTTP Status code processing

SYNOPSIS

use HTTP::Status;

if ($rc != RC_OK) { 
    print statusMessage($rc), "\n";
}

if (isSuccess($rc)) { ... }
if (isError($rc)) { ... }
if (isRedirect($rc)) { ... }

DESCRIPTION

HTTP::Status is a library of routines for manipulating HTTP Status Codes for libwww-perl.

The following functions can be used as mnemonic status codes:

RC_OK
RC_CREATED
RC_ACCEPTED
RC_NON_AUTHORITATIVE_INFORMATION
RC_NO_CONTENT
RC_MULTIPLE_CHOICES
RC_MOVED_PERMANENTLY
RC_MOVED_TEMPORARILY
RC_SEE_OTHER
RC_NOT_MODIFIED
RC_BAD_REQUEST
RC_UNAUTHORIZED
RC_PAYMENT_REQUIRED
RC_FORBIDDEN
RC_NOT_FOUND
RC_METHOD_NOT_ALLOWED
RC_NONE_ACCEPTABLE
RC_PROXY_AUTHENTICATION_REQUIRED
RC_REQUEST_TIMEOUT
RC_CONFLICT
RC_GONE
RC_AUTHORIZATION_NEEDED
RC_INTERNAL_SERVER_ERROR
RC_NOT_IMPLEMENTED
RC_BAD_GATEWAY
RC_SERVICE_UNAVAILABLE
RC_GATEWAY_TIMEOUT

The statusMessage() function will translate status codes to human readable strings.

The isSuccess(), isError(), and isRedirect() functions will return a true value if the passed status code indicates success, and error, or a redirect respectively.

statusMessage($code)

Return user friendly error message for status code $code

isSuccess($code)

Return a true value if $code is a Success status code

isRedirect($code)

Return a true value if $code is a Redirect status code

isError($code)

Return a true value if $code is an Error status code