summaryrefslogtreecommitdiff
path: root/src/HttpResponse.h
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2022-07-07 12:06:33 -0600
committercflip <cflip@cflip.net>2022-07-07 12:06:33 -0600
commit82c2af5878bb4c695a48c2d0707dffdb9356fce3 (patch)
tree16a6a6fe1a1584bde55935892f02ff89b6f5eedb /src/HttpResponse.h
parent76e6c3d690caac3faa664b7b8b79cbc7c6a58394 (diff)
Add some more abstractions to HttpResponse
Diffstat (limited to 'src/HttpResponse.h')
-rw-r--r--src/HttpResponse.h14
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;
};