Google APIs Client Library for C++
HttpStatusCode Class Reference

This is a helper class for interpreting standard HTTP status codes. More...

#include "client/transport/http_types.h"

List of all members.

Public Types

enum  HttpStatus {
  OK = 200, NO_CONTENT = 204, MULTIPLE_CHOICES = 300, MOVED_PERMANENTLY = 301,
  FOUND = 302, SEE_OTHER = 303, NOT_MODIFIED = 304, TEMPORARY_REDIRECT = 307,
  BAD_REQUEST = 400, UNAUTHORIZED = 401, FORBIDDEN = 403, NOT_FOUND = 404,
  NOT_ALLOWED = 405, NOT_ACCEPTABLE = 406, REQUEST_TIMEOUT = 408, SERVER_ERROR = 500,
  SERVICE_UNAVAILABLE = 503
}
 Symbolic names for some common HTTP Stauts Codes of interest. More...

Static Public Member Functions

static bool IsRedirect (int http_code)
 Returns true if the given HTTP status code indicates an HTTP Redirect.
static bool IsOk (int http_code)
 Returns true if the given HTTP status code indicates a successful request.
static bool IsInformational (int http_code)
 Returns true if the given HTTP status code indicates an informational response.

Detailed Description

This is a helper class for interpreting standard HTTP status codes.

It is not meant to be instantiated.


Member Enumeration Documentation

enum HttpStatus

Symbolic names for some common HTTP Stauts Codes of interest.

The list here is not a complete enumeration of http_code values. It only enumerates the standard codes that are of particular itnerest within this library or might be commonly checked by consumers.

See Section 10 of RFC 2616 for a complete list of standard status codes.

Enumerator:
OK 
NO_CONTENT 
MULTIPLE_CHOICES 
MOVED_PERMANENTLY 
FOUND 
SEE_OTHER 
NOT_MODIFIED 
TEMPORARY_REDIRECT 
BAD_REQUEST 
UNAUTHORIZED 
FORBIDDEN 
NOT_FOUND 
NOT_ALLOWED 
NOT_ACCEPTABLE 
REQUEST_TIMEOUT 
SERVER_ERROR 
SERVICE_UNAVAILABLE 

Member Function Documentation

static bool IsInformational ( int  http_code) [inline, static]

Returns true if the given HTTP status code indicates an informational response.

Parameters:
[in]http_codeDenotes an HTTP status code.
Returns:
true if the code is a 1xx series response code (100..199)
static bool IsOk ( int  http_code) [inline, static]

Returns true if the given HTTP status code indicates a successful request.

Parameters:
[in]http_codeDenotes an HTTP status code.
Returns:
true if the code is a 2xx series response code (200..299)
static bool IsRedirect ( int  http_code) [inline, static]

Returns true if the given HTTP status code indicates an HTTP Redirect.

Parameters:
[in]http_codeDenotes an HTTP status code
Returns:
true if the code indicates a standard type of redirect (300..303, 305..307).

HTTP 1.1 only defines 300-307 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines