3 This file is part of libmsphttp
4 Copyright © 2008 Mikkosoft Productions, Mikko Rasa
5 Distributed under the LGPL
8 #ifndef MSP_HTTP_MESSAGE_H_
9 #define MSP_HTTP_MESSAGE_H_
13 #include <msp/core/variant.h>
22 typedef std::map<std::string, std::string> HeaderMap;
27 unsigned chunk_length;
33 virtual ~Message() { }
35 void set_header(const std::string &, const std::string &);
36 bool has_header(const std::string &) const;
37 const std::string &get_header(const std::string &) const;
38 void add_content(const std::string &);
39 const std::string &get_content() const { return content; }
40 void set_user_data(const Variant &);
41 const Variant &get_user_data() const { return user_data; }
42 bool is_complete() const { return complete; }
43 unsigned parse_content(const std::string &);
44 virtual std::string str() const = 0;
46 unsigned parse_headers(const std::string &);
47 std::string str_common() const;
48 std::string normalize_header_name(const std::string &) const;