1 #ifndef MSP_HTTP_MESSAGE_H_
2 #define MSP_HTTP_MESSAGE_H_
6 #include <msp/core/variant.h>
15 typedef std::map<std::string, std::string> HeaderMap;
20 unsigned chunk_length;
26 virtual ~Message() { }
28 void set_header(const std::string &, const std::string &);
29 bool has_header(const std::string &) const;
30 const std::string &get_header(const std::string &) const;
31 void add_content(const std::string &);
32 const std::string &get_content() const { return content; }
33 void set_user_data(const Variant &);
34 const Variant &get_user_data() const { return user_data; }
35 bool is_complete() const { return complete; }
36 unsigned parse_content(const std::string &);
37 virtual std::string str() const = 0;
39 unsigned parse_headers(const std::string &);
40 std::string str_common() const;
41 std::string normalize_header_name(const std::string &) const;