10 #ifndef __PION_HTTPTYPES_HEADER__
11 #define __PION_HTTPTYPES_HEADER__
14 #include <pion/PionConfig.hpp>
15 #include <pion/PionHashMap.hpp>
30 static const std::string STRING_EMPTY;
31 static const std::string STRING_CRLF;
32 static const std::string STRING_HTTP_VERSION;
33 static const std::string HEADER_NAME_VALUE_DELIMITER;
36 static const std::string HEADER_HOST;
37 static const std::string HEADER_COOKIE;
38 static const std::string HEADER_SET_COOKIE;
39 static const std::string HEADER_CONNECTION;
40 static const std::string HEADER_CONTENT_TYPE;
41 static const std::string HEADER_CONTENT_LENGTH;
42 static const std::string HEADER_CONTENT_LOCATION;
43 static const std::string HEADER_CONTENT_ENCODING;
44 static const std::string HEADER_LAST_MODIFIED;
45 static const std::string HEADER_IF_MODIFIED_SINCE;
46 static const std::string HEADER_TRANSFER_ENCODING;
47 static const std::string HEADER_LOCATION;
48 static const std::string HEADER_AUTHORIZATION;
49 static const std::string HEADER_REFERER;
50 static const std::string HEADER_USER_AGENT;
51 static const std::string HEADER_X_FORWARDED_FOR;
52 static const std::string HEADER_CLIENT_IP;
55 static const std::string CONTENT_TYPE_HTML;
56 static const std::string CONTENT_TYPE_TEXT;
57 static const std::string CONTENT_TYPE_XML;
58 static const std::string CONTENT_TYPE_URLENCODED;
61 static const std::string REQUEST_METHOD_HEAD;
62 static const std::string REQUEST_METHOD_GET;
63 static const std::string REQUEST_METHOD_PUT;
64 static const std::string REQUEST_METHOD_POST;
65 static const std::string REQUEST_METHOD_DELETE;
68 static const std::string RESPONSE_MESSAGE_OK;
69 static const std::string RESPONSE_MESSAGE_CREATED;
70 static const std::string RESPONSE_MESSAGE_ACCEPTED;
71 static const std::string RESPONSE_MESSAGE_NO_CONTENT;
72 static const std::string RESPONSE_MESSAGE_FOUND;
73 static const std::string RESPONSE_MESSAGE_UNAUTHORIZED;
74 static const std::string RESPONSE_MESSAGE_FORBIDDEN;
75 static const std::string RESPONSE_MESSAGE_NOT_FOUND;
76 static const std::string RESPONSE_MESSAGE_METHOD_NOT_ALLOWED;
77 static const std::string RESPONSE_MESSAGE_NOT_MODIFIED;
78 static const std::string RESPONSE_MESSAGE_BAD_REQUEST;
79 static const std::string RESPONSE_MESSAGE_SERVER_ERROR;
80 static const std::string RESPONSE_MESSAGE_NOT_IMPLEMENTED;
81 static const std::string RESPONSE_MESSAGE_CONTINUE;
84 static const unsigned int RESPONSE_CODE_OK;
85 static const unsigned int RESPONSE_CODE_CREATED;
86 static const unsigned int RESPONSE_CODE_ACCEPTED;
87 static const unsigned int RESPONSE_CODE_NO_CONTENT;
88 static const unsigned int RESPONSE_CODE_FOUND;
89 static const unsigned int RESPONSE_CODE_UNAUTHORIZED;
90 static const unsigned int RESPONSE_CODE_FORBIDDEN;
91 static const unsigned int RESPONSE_CODE_NOT_FOUND;
92 static const unsigned int RESPONSE_CODE_METHOD_NOT_ALLOWED;
93 static const unsigned int RESPONSE_CODE_NOT_MODIFIED;
94 static const unsigned int RESPONSE_CODE_BAD_REQUEST;
95 static const unsigned int RESPONSE_CODE_SERVER_ERROR;
96 static const unsigned int RESPONSE_CODE_NOT_IMPLEMENTED;
97 static const unsigned int RESPONSE_CODE_CONTINUE;
110 static std::string get_date_string(
const time_t t);
113 static std::string make_query_string(
const QueryParams& query_params);
126 static std::string make_set_cookie_header(
const std::string& name,
127 const std::string& value,
128 const std::string& path,
129 const bool has_max_age =
false,
130 const unsigned long max_age = 0);
PION_HASH_MULTIMAP< std::string, std::string, CaseInsensitiveHash, CaseInsensitiveEqual > StringDictionary
data type for case-insensitive dictionary of strings
virtual ~HTTPTypes()
virtual destructor
StringDictionary Headers
data type for HTTP headers
StringDictionary QueryParams
data type for HTTP query parameters
StringDictionary CookieParams
data type for HTTP cookie parameters
the following enables use of the lock-free cache