/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ARequest.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mmoussou #include #include #include #include #include #include #include #include #include namespace webserv { namespace http { class ARequest : public http::IMessage { public: virtual ~ARequest(void) { log("➖", "ARequest", "destructor called"); delete _url; } virtual void parse(std::string const &data) = 0; virtual Response execute(void) = 0; std::string str(void) const; std::string getMethod(void) const; std::string getTarget(void) const; std::string getProtocol(void) const; webserv::config::Route *getRoute(void) const; URL getUrl() const; void setMethod(std::string const method); void setTarget(std::string const target); void setProtocol(std::string const protocol); void setServer(std::string const protocol); void setRoute(config::Route *route); protected: std::string _method; std::string _target; std::string _protocol; webserv::config::Route *_route; URL *_url; std::string _sanitizeStr(std::string &str) { std::string newStr = str; if (str[str.size() - 1] == '\r') { newStr.erase(str.size() - 1); } return newStr; } }; } // namespace http } // namespace webserv