diff options
Diffstat (limited to 'src/HttpResponse.h')
-rw-r--r-- | src/HttpResponse.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/HttpResponse.h b/src/HttpResponse.h index 33148da..8a1d2d4 100644 --- a/src/HttpResponse.h +++ b/src/HttpResponse.h @@ -1,18 +1,22 @@ #pragma once -#include <sstream> +#include <map> #include <string> -enum class ResponseCode { +enum class HttpStatusCode { OK = 200 }; class HttpResponse { public: - HttpResponse(ResponseCode); + HttpResponse(HttpStatusCode status_code); + + void add_header(const std::string& header, const std::string& value); + void set_content(const std::string& content) { m_content = content; } - void add_header(std::string header); std::string to_string() const; private: - std::stringstream m_string_stream; + HttpStatusCode m_status_code; + std::map<std::string, std::string> m_headers; + std::string m_content; }; |