HTTP_StatusLocated in: Program_Root/HTTP_Status.php
PHP class for determining HTTP Status codes.
This class is mainly based on Status.pm <http://search.cpan.org/author/GAAS/libwww-perl-5.65/
lib/HTTP/Status.pm> from the libwww-perl collection <http://www.linpro.no/lwp/>.
This file will also define the following constants:
- RC_CONTINUE (100)
- RC_SWITCHING_PROTOCOLS (101)
- RC_PROCESSING (102)
- RC_OK (200)
- RC_CREATED (201)
- RC_ACCEPTED (202)
- RC_NON_AUTHORITATIVE_INFORMATION (203)
- RC_NO_CONTENT (204)
- RC_RESET_CONTENT (205)
- RC_PARTIAL_CONTENT (206)
- RC_MULTI_STATUS (207)
- RC_MULTIPLE_CHOICES (300)
- RC_MOVED_PERMANENTLY (301)
- RC_FOUND (302)
- RC_SEE_OTHER (303)
- RC_NOT_MODIFIED (304)
- RC_USE_PROXY (305)
- RC_TEMPORARY_REDIRECT (307)
- RC_BAD_REQUEST (400)
- RC_UNAUTHORIZED (401)
- RC_PAYMENT_REQUIRED (402)
- RC_FORBIDDEN (403)
- RC_NOT_FOUND (404)
- RC_METHOD_NOT_ALLOWED (405)
- RC_NOT_ACCEPTABLE (406)
- RC_PROXY_AUTHENTICATION_REQUIRED (407)
- RC_REQUEST_TIMEOUT (408)
- RC_CONFLICT (409)
- RC_GONE (410)
- RC_LENGTH_REQUIRED (411)
- RC_PRECONDITION_FAILED (412)
- RC_REQUEST_ENTITY_TOO_LARGE (413)
- RC_REQUEST_URI_TOO_LARGE (414)
- RC_UNSUPPORTED_MEDIA_TYPE (415)
- RC_REQUEST_RANGE_NOT_SATISFIABLE (416)
- RC_EXPECTATION_FAILED (417)
- RC_UNPROCESSABLE_ENTITY (422)
- RC_LOCKED (423)
- RC_FAILED_DEPENDENCY (424)
- RC_INTERNAL_SERVER_ERROR (500)
- RC_NOT_IMPLEMENTED (501)
- RC_BAD_GATEWAY (502)
- RC_SERVICE_UNAVAILABLE (503)
- RC_GATEWAY_TIMEOUT (504)
- RC_HTTP_VERSION_NOT_SUPPORTED (505)
- RC_INSUFFICIENT_STORAGE (507)
Example:
$code = $response->get_status_code();
echo HTTP_Status::get_message($code);
if (HTTP_Status::is_error($code)) echo 'Failed :(';
default0.1Keyvan Minoukadeh <keyvan@k1m.com> string |
get_message ( $code )
Get status message |
bool |
is_client_error ( $code )
Is client error |
bool |
is_error ( $code )
Is error |
bool |
is_info ( $code )
Is info |
bool |
is_redirect ( $code )
Is redirect |
bool |
is_server_error ( $code )
Is server error |
bool |
is_success ( $code )
Is success |
string get_message ( $code ) |
Get status message
This method will translate status codes to human readable strings. If the $code is unknown, false is returned.
|
bool is_client_error ( $code ) |
Is client error
This class of status code is intended for cases in which the client seems to have erred.
|
bool is_error ( $code ) |
Is error
Returns true for both client or server error status codes.
|
bool is_info ( $code ) |
Is info
This class of status code indicates a provisional response which can't have any content.
|
bool is_redirect ( $code ) |
Is redirect
This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request.
|
bool is_server_error ( $code ) |
Is server error
This class of status codes is intended for cases in which the server is aware that it has erred or is incapable of performing the request.
|
bool is_success ( $code ) |
Is success
|