Saturday, September 10, 2016

HTTP Status Codes

HTTP Status Codes


HTTP Status Codes ^

From http_protocol.c and httpd.h - RESPONSE_CODES 83
These are the codes in a shell-script friendly fashion.

1xx Info / Informational ^

  • 100 Continue
  • 101 Switching Protocols
  • 102 Processing

2xx Success / OK ^

  • 200 OK
  • 201 Created
  • 202 Accepted
  • 203 Non-Authoritative Information
  • 204 No Content
  • 205 Reset Content
  • 206 Partial Content
  • 207 Multi-Status
  • 208 Already Reported
  • 226 IM Used

3xx Redirect ^

  • 300 Multiple Choices
  • 301 Moved Permanently
  • 302 Found
  • 303 See Other
  • 304 Not Modified
  • 305 Use Proxy
  • 307 Temporary Redirect
  • 308 Permanent Redirect

4xx Client Error ^

  • 400 Bad Request
  • 401 Unauthorized
  • 402 Payment Required
  • 403 Forbidden
  • 404 Not Found
  • 405 Method Not Allowed
  • 406 Not Acceptable
  • 407 Proxy Authentication Required
  • 408 Request Timeout
  • 409 Conflict
  • 410 Gone
  • 411 Length Required
  • 412 Precondition Failed
  • 413 Request Entity Too Large
  • 414 Request-URI Too Long
  • 415 Unsupported Media Type
  • 416 Requested Range Not Satisfiable
  • 417 Expectation Failed
  • 422 Unprocessable Entity
  • 423 Locked
  • 424 Failed Dependency
  • 426 Upgrade Required
  • 428 Precondition Required
  • 429 Too Many Requests
  • 431 Request Header Fields Too Large

5xx Server Error ^

  • 500 Internal Server Error
  • 501 Not Implemented
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout
  • 505 HTTP Version Not Supported
  • 506 Variant Also Negotiates
  • 507 Insufficient Storage
  • 508 Loop Detected
  • 510 Not Extended
  • 511 Network Authentication Required

Status Codes in C ^

static const value_string vals_status_code[] = {
{ 100, "Continue" },
{ 101, "Switching Protocols" },
{ 102, "Processing" },
{ 199, "Informational - Others" },
 
{ 200, "OK"},
{ 201, "Created"},
{ 202, "Accepted"},
{ 203, "Non-authoritative Information"},
{ 204, "No Content"},
{ 205, "Reset Content"},
{ 206, "Partial Content"},
{ 207, "Multi-Status"},
{ 299, "Success - Others"},
 
{ 300, "Multiple Choices"},
{ 301, "Moved Permanently"},
{ 302, "Found"},
{ 303, "See Other"},
{ 304, "Not Modified"},
{ 305, "Use Proxy"},
{ 307, "Temporary Redirect"},
{ 399, "Redirection - Others"},
 
{ 400, "Bad Request"},
{ 401, "Unauthorized"},
{ 402, "Payment Required"},
{ 403, "Forbidden"},
{ 404, "Not Found"},
{ 405, "Method Not Allowed"},
{ 406, "Not Acceptable"},
{ 407, "Proxy Authentication Required"},
{ 408, "Request Time-out"},
{ 409, "Conflict"},
{ 410, "Gone"},
{ 411, "Length Required"},
{ 412, "Precondition Failed"},
{ 413, "Request Entity Too Large"},
{ 414, "Request-URI Too Long"},
{ 415, "Unsupported Media Type"},
{ 416, "Requested Range Not Satisfiable"},
{ 417, "Expectation Failed"},
{ 418, "I'm a teapot"}, /* RFC 2324 */
{ 422, "Unprocessable Entity"},
{ 423, "Locked"},
{ 424, "Failed Dependency"},
{ 499, "Client Error - Others"},
 
{ 500, "Internal Server Error"},
{ 501, "Not Implemented"},
{ 502, "Bad Gateway"},
{ 503, "Service Unavailable"},
{ 504, "Gateway Time-out"},
{ 505, "HTTP Version not supported"},
{ 507, "Insufficient Storage"},
{ 599, "Server Error - Others"},
 
{ 0, NULL}


PHP of Updated Codes ^



array(
// INFORMATIONAL CODES
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',

// SUCCESS CODES
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
207 => 'Multi-status',
208 => 'Already Reported',

// REDIRECTION CODES
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
306 => 'Switch Proxy', // Deprecated
307 => 'Temporary Redirect',

// CLIENT ERROR
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required',
408 => 'Request Time-out',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed',
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Large',
415 => 'Unsupported Media Type',
416 => 'Requested range not satisfiable',
417 => 'Expectation Failed',
418 => 'I\'m a teapot',
422 => 'Unprocessable Entity',
423 => 'Locked',
424 => 'Failed Dependency',
425 => 'Unordered Collection',
426 => 'Upgrade Required',
428 => 'Precondition Required',
429 => 'Too Many Requests',
431 => 'Request Header Fields Too Large',

// SERVER ERROR
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Time-out',
505 => 'HTTP Version not supported',
506 => 'Variant Also Negotiates',
507 => 'Insufficient Storage',
508 => 'Loop Detected',
511 => 'Network Authentication Required'
);

Apache Internal Status Code Names ^

The rest of the 83 Codes are NULL for future use.
  • 100 = HTTP_CONTINUE
  • 101 = HTTP_SWITCHING_PROTOCOLS
  • 102 = HTTP_PROCESSING
  • 200 = HTTP_OK
  • 201 = HTTP_CREATED
  • 202 = HTTP_ACCEPTED
  • 203 = HTTP_NON_AUTHORITATIVE
  • 204 = HTTP_NO_CONTENT
  • 205 = HTTP_RESET_CONTENT
  • 206 = HTTP_PARTIAL_CONTENT
  • 207 = HTTP_MULTI_STATUS
  • 208 = HTTP_ALREADY_REPORTED
  • 226 = HTTP_IM_USED
  • 300 = HTTP_MULTIPLE_CHOICES
  • 301 = HTTP_MOVED_PERMANENTLY
  • 302 = HTTP_MOVED_TEMPORARILY
  • 303 = HTTP_SEE_OTHER
  • 304 = HTTP_NOT_MODIFIED
  • 305 = HTTP_USE_PROXY
  • 307 = HTTP_TEMPORARY_REDIRECT
  • 308 = HTTP_PERMANENT_REDIRECT
  • 400 = HTTP_BAD_REQUEST
  • 401 = HTTP_UNAUTHORIZED
  • 402 = HTTP_PAYMENT_REQUIRED
  • 403 = HTTP_FORBIDDEN
  • 404 = HTTP_NOT_FOUND
  • 405 = HTTP_METHOD_NOT_ALLOWED
  • 406 = HTTP_NOT_ACCEPTABLE
  • 407 = HTTP_PROXY_AUTHENTICATION_REQUIRED
  • 408 = HTTP_REQUEST_TIME_OUT
  • 409 = HTTP_CONFLICT
  • 410 = HTTP_GONE
  • 411 = HTTP_LENGTH_REQUIRED
  • 412 = HTTP_PRECONDITION_FAILED
  • 413 = HTTP_REQUEST_ENTITY_TOO_LARGE
  • 414 = HTTP_REQUEST_URI_TOO_LARGE
  • 415 = HTTP_UNSUPPORTED_MEDIA_TYPE
  • 416 = HTTP_RANGE_NOT_SATISFIABLE
  • 417 = HTTP_EXPECTATION_FAILED
  • 422 = HTTP_UNPROCESSABLE_ENTITY
  • 423 = HTTP_LOCKED
  • 424 = HTTP_FAILED_DEPENDENCY
  • 426 = HTTP_UPGRADE_REQUIRED
  • 428 = HTTP_PRECONDITION_REQUIRED
  • 429 = HTTP_TOO_MANY_REQUESTS
  • 431 = HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE
  • 500 = HTTP_INTERNAL_SERVER_ERROR
  • 501 = HTTP_NOT_IMPLEMENTED
  • 502 = HTTP_BAD_GATEWAY
  • 503 = HTTP_SERVICE_UNAVAILABLE
  • 504 = HTTP_GATEWAY_TIME_OUT
  • 505 = HTTP_VERSION_NOT_SUPPORTED
  • 506 = HTTP_VARIANT_ALSO_VARIES
  • 507 = HTTP_INSUFFICIENT_STORAGE
  • 508 = HTTP_LOOP_DETECTED
  • 510 = HTTP_NOT_EXTENDED
  • 511 = HTTP_NETWORK_AUTHENTICATION_REQUIRED

No comments:

Post a Comment