ffead.server.doc
HTTPResponseStatus.cpp
1 /*
2  Copyright 2009-2012, Sumeet Chhetri
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 /*
17  * HTTPResponseStatus.cpp
18  *
19  * Created on: 25-Jan-2013
20  * Author: sumeetc
21  */
22 
23 #include "HTTPResponseStatus.h"
24 
25 HTTPResponseStatus HTTPResponseStatus::Continue(100, "Continue");
26 HTTPResponseStatus HTTPResponseStatus::Switching(101, "Switching protocols");
27 HTTPResponseStatus HTTPResponseStatus::Ok(200, "OK");
28 HTTPResponseStatus HTTPResponseStatus::Created(201, "Created");
29 HTTPResponseStatus HTTPResponseStatus::Accepted(202, "Accepted");
30 HTTPResponseStatus HTTPResponseStatus::NonAuthInfo(203, "Non-authoritative information");
31 HTTPResponseStatus HTTPResponseStatus::NoContent(204, "No content");
32 HTTPResponseStatus HTTPResponseStatus::ResetContent(205, "Reset content");
33 HTTPResponseStatus HTTPResponseStatus::PartialContent(206, "Partial content");
34 HTTPResponseStatus HTTPResponseStatus::ObjectMoved(302, "Object moved");
35 HTTPResponseStatus HTTPResponseStatus::MovedPermanently(303, "Moved Permanently");
36 HTTPResponseStatus HTTPResponseStatus::NotModified(304, "Not modified");
37 HTTPResponseStatus HTTPResponseStatus::TempRedirect(307, "Temporary redirect");
38 HTTPResponseStatus HTTPResponseStatus::BadRequest(400, "Bad request");
39 HTTPResponseStatus HTTPResponseStatus::AccessDenied(401, "Access denied");
40 HTTPResponseStatus HTTPResponseStatus::Unauthorized(401, "Unauthorized\r\nWWW-Authenticate: Invalid authentication details");
41 HTTPResponseStatus HTTPResponseStatus::Forbidden(403, "Forbidden");
42 HTTPResponseStatus HTTPResponseStatus::NotFound(404, "Not found");
43 HTTPResponseStatus HTTPResponseStatus::InvalidMethod(405, "HTTP verb used to access this page is not allowed (method not allowed)");
44 HTTPResponseStatus HTTPResponseStatus::InvalidMime(406, "Client browser does not accept the MIME type of the requested page");
45 HTTPResponseStatus HTTPResponseStatus::ProxyAuthRequired(407, "Proxy authentication required");
46 HTTPResponseStatus HTTPResponseStatus::PreconditionFailed(412, "Precondition failed");
47 HTTPResponseStatus HTTPResponseStatus::ReqEntityLarge(413, "Request entity too large");
48 HTTPResponseStatus HTTPResponseStatus::ReqUrlLarge(414, "Request-URL too long");
49 HTTPResponseStatus HTTPResponseStatus::UnsupportedMedia(415, "Unsupported media type");
50 HTTPResponseStatus HTTPResponseStatus::InvalidReqRange(416, "Requested range not satisfiable");
51 HTTPResponseStatus HTTPResponseStatus::ExecutionFailed(417, "Execution failed");
52 HTTPResponseStatus HTTPResponseStatus::LockedError(423, "Locked error");
53 HTTPResponseStatus HTTPResponseStatus::InternalServerError(500, "Internal server error");
54 HTTPResponseStatus HTTPResponseStatus::InvalidHeaderConf(501, "Header values specify a configuration that is not implemented");
55 HTTPResponseStatus HTTPResponseStatus::BadGateway(502, "Bad Gateway");
56 HTTPResponseStatus HTTPResponseStatus::ServiceUnavailable(503, "Service unavailable");
57 HTTPResponseStatus HTTPResponseStatus::GatewayTimeout(504, "Gateway timeout");
58 HTTPResponseStatus HTTPResponseStatus::HttpVersionNotSupported(505, "HTTP version not supported");
59 
60 HTTPResponseStatus::HTTPResponseStatus() {
61 
62 }
63 
64 HTTPResponseStatus::HTTPResponseStatus(int code, string msg) {
65  this->code = code;
66  this->msg = msg;
67 }
68 
69 HTTPResponseStatus::~HTTPResponseStatus() {
70  // TODO Auto-generated destructor stub
71 }
72 
73 int HTTPResponseStatus::getCode()
74 {
75  return code;
76 }
77 string HTTPResponseStatus::getMsg()
78 {
79  return msg;
80 }