diff --git a/includes/default.hpp b/includes/default.hpp deleted file mode 100644 index fc55644..0000000 --- a/includes/default.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* default.hpp :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mmoussou +#include + +namespace webserv { +namespace http { + +class IMessage { +public: + virtual std::map getHeaders(void) const; + virtual std::string getBody(void) const; + + virtual void setHeaders(std::map const headers); + virtual void setBody(std::string const body); + + virtual void addHeader(std::string const name, std::string const value); + virtual void rmHeader(std::string const name); + + virtual std::string str(void) const = 0; + +protected: + std::map _headers; + std::string _body; + +}; + +} // -namespace http +} // -namespace webserv + +#endif // __WEBSERV_REQUESTS_HTTP_IMESSAGE_HPP__ diff --git a/includes/requests/HttpRequest.hpp b/includes/requests/HttpRequest.hpp index 18b60c8..7b4911c 100644 --- a/includes/requests/HttpRequest.hpp +++ b/includes/requests/HttpRequest.hpp @@ -6,7 +6,7 @@ /* By: mmoussou +#include +#include + +#include +#include namespace webserv { namespace http { diff --git a/includes/requests/HttpResponse.hpp b/includes/requests/HttpResponse.hpp index b618248..9db5b92 100644 --- a/includes/requests/HttpResponse.hpp +++ b/includes/requests/HttpResponse.hpp @@ -6,7 +6,7 @@ /* By: mmoussou namespace webserv { namespace http { @@ -41,6 +41,8 @@ public: void setStatusCode(size_t const status_code); void setStatusText(std::string const status_text); + std::string str(void) const; + private: std::string _protocol; size_t _status_code; diff --git a/includes/requests/default.hpp b/includes/requests/default.hpp index 220f40c..946cda1 100644 --- a/includes/requests/default.hpp +++ b/includes/requests/default.hpp @@ -6,7 +6,7 @@ /* By: mmoussou -#include -#include -#include -#include - -#include "default.hpp" -#include "requests/HttpRequest.hpp" -#include "requests/HttpResponse.hpp" - -namespace webserv { -namespace http { - -class IMessage { -public: - virtual std::map getHeaders(void) const; - virtual std::string getBody(void) const; - - virtual void setHeaders(std::map const headers); - virtual void setBody(std::string const body); - - virtual void addHeader(std::string const name, std::string const value); - virtual void rmHeader(std::string const name); - -protected: - std::map _headers; - std::string _body; - -}; - -} // -namespace http -} // -namespace webserv +#include +#include #endif // __WEBSERV_REQUESTS_DEFAULT_HPP__ diff --git a/includes/server/default.hpp b/includes/server/default.hpp index 5ca19f5..f648bec 100644 --- a/includes/server/default.hpp +++ b/includes/server/default.hpp @@ -6,7 +6,7 @@ /* By: mmoussou +#include #define PORT 8080 #define BUFFER_SIZE 4096