restcgi::status_code_e Class Reference

List of all members.

Detailed Description

HTTP status code enumeration.

Note that the exception classes and exception_responder can be used to send the status code automatically when exceptions are thrown.

See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html


Public Types

 null
 none
 CONTINUE
 Continue.
 SWITCHING_PROTOCOLS
 OK
 CREATED
 ACCEPTED
 Accepted.
 NON_AUTHORITATIVE_INFORMATION
 NO_CONTENT
 RESET_CONTENT
 PARTIAL_CONTENT
 Partial content.
 MULTIPLE_CHOICES
 Multiple choices.
 MOVED_PERMANENTLY
 Moved permanently.
 FOUND
 SEE_OTHER
 NOT_MODIFIED
 USE_PROXY
 Use proxy.
 TEMPORARY_REDIRECT
 BAD_REQUEST
 UNAUTHORIZED
 PAYMENT_REQUIRED
 Payment required.
 FORBIDDEN
 NOT_FOUND
 METHOD_NOT_ALLOWED
 NOT_ACCEPTABLE
 Not acceptable.
 PROXY_AUTHENTICATION_REQUIRED
 Proxy authentication required.
 REQUEST_TIME_OUT
 CONFLICT
 GONE
 LENGTH_REQUIRED
 PRECONDITION_FAILED
 REQUEST_ENTITY_TOO_LARGE
 REQUEST_URI_TOO_LARGE
 UNSUPPORTED_MEDIA_TYPE
 REQUESTED_RANGE_NOT_SATISFIABLE
 Requested range not satisfiable.
 EXPECTATION_FAILED
 INTERNAL_SERVER_ERROR
 NOT_IMPLEMENTED
 Not implemented.
 BAD_GATEWAY
 Bad gateway.
 SERVICE_UNAVAILABLE
 Service unavailable.
 GATEWAY_TIME_OUT
 Gateway time out.
 HTTP_VERSION_NOT_SUPPORTED
 HTTP version not supported.
enum  e {
  null, CONTINUE, SWITCHING_PROTOCOLS, OK,
  CREATED, ACCEPTED, NON_AUTHORITATIVE_INFORMATION, NO_CONTENT,
  RESET_CONTENT, PARTIAL_CONTENT, MULTIPLE_CHOICES, MOVED_PERMANENTLY,
  FOUND, SEE_OTHER, NOT_MODIFIED, USE_PROXY,
  TEMPORARY_REDIRECT, BAD_REQUEST, UNAUTHORIZED, PAYMENT_REQUIRED,
  FORBIDDEN, NOT_FOUND, METHOD_NOT_ALLOWED, NOT_ACCEPTABLE,
  PROXY_AUTHENTICATION_REQUIRED, REQUEST_TIME_OUT, CONFLICT, GONE,
  LENGTH_REQUIRED, PRECONDITION_FAILED, REQUEST_ENTITY_TOO_LARGE, REQUEST_URI_TOO_LARGE,
  UNSUPPORTED_MEDIA_TYPE, REQUESTED_RANGE_NOT_SATISFIABLE, EXPECTATION_FAILED, INTERNAL_SERVER_ERROR,
  NOT_IMPLEMENTED, BAD_GATEWAY, SERVICE_UNAVAILABLE, GATEWAY_TIME_OUT,
  HTTP_VERSION_NOT_SUPPORTED
}
 Enumeration. More...

Public Member Functions

 status_code_e ()
 Construct.
 status_code_e (int code)
 Construct from integer code, for example 200 is OK.
 status_code_e (e t)
 Construct from enum, for example status_code_e::OK.
e enumeration () const
 Get enumeration.
bool is_null () const
const char * cstring () const
 cstring representation, including int, for example OK is "200 OK".
 operator int () const
 int representation, for example OK is 200.
bool operator== (const status_code_e &rhs) const
 Equal operator.
bool operator== (const status_code_e::e &rhs) const
 Equal operator.
bool operator< (const status_code_e &rhs) const
 Less operator.
bool operator< (const status_code_e::e &rhs) const
 Less operator.
std::ostream & operator<< (std::ostream &os) const
 Stream out in HTTP header format.

Static Public Attributes

static const char EOL_CSTR [3]
 end-of-line ("\r\n")


Member Enumeration Documentation

enum restcgi::status_code_e::e

Enumeration.

Enumerator:
null  none
CONTINUE  Continue.
SWITCHING_PROTOCOLS  Switching protocols
OK  OK (successful): Set automatically upon successful completion of all responses except POST.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1
CREATED  Created (successful): Application should set in the POST response upon successful completion.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2
ACCEPTED  Accepted.
NON_AUTHORITATIVE_INFORMATION  Non-authoritative information
NO_CONTENT  No content (successful): The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation. The response MAY include new or updated metainformation in the form of entity-headers, which if present SHOULD be associated with the requested variant. If the client is a user agent, it SHOULD NOT change its document view from that which caused the request to be sent. This response is primarily intended to allow input for actions to take place without causing a change to the user agent's active document view, although any new or updated metainformation SHOULD be applied to the document currently in the user agent's active view. Must not include (entity) content.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5
RESET_CONTENT  Reset content (successful): The server has fulfilled the request and the user agent SHOULD reset the document view which caused the request to be sent. This response is primarily intended to allow input for actions to take place via user input, followed by a clearing of the form in which the input is given so that the user can easily initiate another input action. Must not include (entity) content.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.6
PARTIAL_CONTENT  Partial content.
MULTIPLE_CHOICES  Multiple choices.
MOVED_PERMANENTLY  Moved permanently.
FOUND  Fount
SEE_OTHER  See Other (redirection): The response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource. The different URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4
NOT_MODIFIED  Not Modified (redirection): Set automatically when ???????????? resource does not meet the modified constraint. ETag and/or Content-Location must also be sent. Must not include (entity) content.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5
USE_PROXY  Use proxy.
TEMPORARY_REDIRECT  Temporary redirect
BAD_REQUEST  Bad request (client): endpoint sets automatically when the request header is malformed, or set when the path is unrecognized (not just a missing resource due to a bad id). Application can also set if the path or query is unrecognized, include error content.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1
UNAUTHORIZED  Unauthorized (client): Application should set/throw if the request requires user authentication and none is provided.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2
PAYMENT_REQUIRED  Payment required.
FORBIDDEN  Forbidden
NOT_FOUND  Not Found (client): Set automatically when a resource is not found. Note that BAD_REQUEST should be used if there is an error in the path or query (not just an unresolvable resource id).
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5
METHOD_NOT_ALLOWED  Method Not Allowed (client): resource sets automatically when method not supported. Must include an allow header containing list of valid methods for the resource.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6
NOT_ACCEPTABLE  Not acceptable.
PROXY_AUTHENTICATION_REQUIRED  Proxy authentication required.
REQUEST_TIME_OUT  Request time out
CONFLICT  Conflict (client): Application should set/throw if the request could not be completed due to a conflict with the current state of the resource. For example, if there is a dependency which is unmet, say, before deleting an resource. Application should include error content identifying the conflict and remedies.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10
GONE  Gone (client): Application should set/throw if the referenced resource has been deleted but could be undeleted. Include error content.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11
LENGTH_REQUIRED  Length required
PRECONDITION_FAILED  Precondition Failed (client): Set automatically when resource does not meet the unmodified constraint.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13
REQUEST_ENTITY_TOO_LARGE  Request Entity Too Large (client): Application should set/throw if the request entity is larger than the server is willing or able to process. The server MAY close the connection to prevent the client from continuing the request.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14
REQUEST_URI_TOO_LARGE  Request URI too large
UNSUPPORTED_MEDIA_TYPE  Unsupported Media Type (client): Application should set/throw if the entity of the request is in a format not supported by the requested resource for the requested method.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16
REQUESTED_RANGE_NOT_SATISFIABLE  Requested range not satisfiable.
EXPECTATION_FAILED  Expectation failed
INTERNAL_SERVER_ERROR  Internal Server Error (server): Set automatically when any exception without an explicit status code is caught.
See also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1
NOT_IMPLEMENTED  Not implemented.
BAD_GATEWAY  Bad gateway.
SERVICE_UNAVAILABLE  Service unavailable.
GATEWAY_TIME_OUT  Gateway time out.
HTTP_VERSION_NOT_SUPPORTED  HTTP version not supported.


Member Function Documentation

bool restcgi::status_code_e::is_null (  )  const [inline]

Test if null.


Generated on Fri May 15 11:27:12 2009 for restcgi by  doxygen 1.4.7