10 #ifndef __PION_HTTP_TYPES_HEADER__ 11 #define __PION_HTTP_TYPES_HEADER__ 14 #include <pion/config.hpp> 15 #include <pion/hash_map.hpp> 31 static const std::string STRING_EMPTY;
32 static const std::string STRING_CRLF;
33 static const std::string STRING_HTTP_VERSION;
34 static const std::string HEADER_NAME_VALUE_DELIMITER;
35 static const std::string COOKIE_NAME_VALUE_DELIMITER;
38 static const std::string HEADER_HOST;
39 static const std::string HEADER_COOKIE;
40 static const std::string HEADER_SET_COOKIE;
41 static const std::string HEADER_CONNECTION;
42 static const std::string HEADER_CONTENT_TYPE;
43 static const std::string HEADER_CONTENT_LENGTH;
44 static const std::string HEADER_CONTENT_LOCATION;
45 static const std::string HEADER_CONTENT_ENCODING;
46 static const std::string HEADER_CONTENT_DISPOSITION;
47 static const std::string HEADER_LAST_MODIFIED;
48 static const std::string HEADER_IF_MODIFIED_SINCE;
49 static const std::string HEADER_TRANSFER_ENCODING;
50 static const std::string HEADER_LOCATION;
51 static const std::string HEADER_AUTHORIZATION;
52 static const std::string HEADER_REFERER;
53 static const std::string HEADER_USER_AGENT;
54 static const std::string HEADER_X_FORWARDED_FOR;
55 static const std::string HEADER_CLIENT_IP;
58 static const std::string CONTENT_TYPE_HTML;
59 static const std::string CONTENT_TYPE_TEXT;
60 static const std::string CONTENT_TYPE_XML;
61 static const std::string CONTENT_TYPE_URLENCODED;
62 static const std::string CONTENT_TYPE_MULTIPART_FORM_DATA;
65 static const std::string REQUEST_METHOD_HEAD;
66 static const std::string REQUEST_METHOD_GET;
67 static const std::string REQUEST_METHOD_PUT;
68 static const std::string REQUEST_METHOD_POST;
69 static const std::string REQUEST_METHOD_DELETE;
72 static const std::string RESPONSE_MESSAGE_OK;
73 static const std::string RESPONSE_MESSAGE_CREATED;
74 static const std::string RESPONSE_MESSAGE_ACCEPTED;
75 static const std::string RESPONSE_MESSAGE_NO_CONTENT;
76 static const std::string RESPONSE_MESSAGE_FOUND;
77 static const std::string RESPONSE_MESSAGE_UNAUTHORIZED;
78 static const std::string RESPONSE_MESSAGE_FORBIDDEN;
79 static const std::string RESPONSE_MESSAGE_NOT_FOUND;
80 static const std::string RESPONSE_MESSAGE_METHOD_NOT_ALLOWED;
81 static const std::string RESPONSE_MESSAGE_NOT_MODIFIED;
82 static const std::string RESPONSE_MESSAGE_BAD_REQUEST;
83 static const std::string RESPONSE_MESSAGE_SERVER_ERROR;
84 static const std::string RESPONSE_MESSAGE_NOT_IMPLEMENTED;
85 static const std::string RESPONSE_MESSAGE_CONTINUE;
88 static const unsigned int RESPONSE_CODE_OK;
89 static const unsigned int RESPONSE_CODE_CREATED;
90 static const unsigned int RESPONSE_CODE_ACCEPTED;
91 static const unsigned int RESPONSE_CODE_NO_CONTENT;
92 static const unsigned int RESPONSE_CODE_FOUND;
93 static const unsigned int RESPONSE_CODE_UNAUTHORIZED;
94 static const unsigned int RESPONSE_CODE_FORBIDDEN;
95 static const unsigned int RESPONSE_CODE_NOT_FOUND;
96 static const unsigned int RESPONSE_CODE_METHOD_NOT_ALLOWED;
97 static const unsigned int RESPONSE_CODE_NOT_MODIFIED;
98 static const unsigned int RESPONSE_CODE_BAD_REQUEST;
99 static const unsigned int RESPONSE_CODE_SERVER_ERROR;
100 static const unsigned int RESPONSE_CODE_NOT_IMPLEMENTED;
101 static const unsigned int RESPONSE_CODE_CONTINUE;
105 static std::string get_date_string(
const time_t t);
108 static std::string make_query_string(
const ihash_multimap& query_params);
121 static std::string make_set_cookie_header(
const std::string& name,
122 const std::string& value,
123 const std::string& path,
124 const bool has_max_age =
false,
125 const unsigned long max_age = 0);
virtual ~types()
virtual destructor