56 static char const header_delimiter[] =
"\r\n";
59 static char const header_separator[] =
":";
62 static std::string
const empty_header;
78 static char const header_token[] = {
79 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
80 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
81 0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,
82 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
83 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
84 1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,
85 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
86 1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,
87 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
88 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
89 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
90 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
91 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
92 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
93 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
94 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
99 return (header_token[c] == 1);
104 return !header_token[c];
112 return (c == 9 || c == 32);
117 return (c != 9 && c != 32);
121 namespace status_code {
182 return "Uninitialized";
186 return "Switching Protocols";
194 return "Non Authoritative Information";
198 return "Reset Content";
200 return "Partial Content";
202 return "Multiple Choices";
204 return "Moved Permanently";
210 return "Not Modified";
214 return "Temporary Redirect";
216 return "Bad Request";
218 return "Unauthorized";
220 return "Payment Required";
226 return "Method Not Allowed";
228 return "Not Acceptable";
230 return "Proxy Authentication Required";
232 return "Request Timeout";
238 return "Length Required";
240 return "Precondition Failed";
242 return "Request Entity Too Large";
244 return "Request-URI Too Long";
246 return "Unsupported Media Type";
248 return "Requested Range Not Satisfiable";
250 return "Expectation Failed";
252 return "I'm a teapot";
254 return "Upgrade Required";
256 return "Precondition Required";
258 return "Too Many Requests";
260 return "Request Header Fields Too Large";
262 return "Internal Server Error";
264 return "Not Implemented";
266 return "Bad Gateway";
268 return "Service Unavailable";
270 return "Gateway Timeout";
272 return "HTTP Version Not Supported";
274 return "Not Extended";
276 return "Network Authentication Required";
287 const std::string& error_msg = std::string(),
288 const std::string& body = std::string())
296 virtual const char*
what()
const throw() {
297 return m_msg.c_str();