mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-03-15 11:36:50 +01:00
「🏗️」 wip: work in progress, not done yet.
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/02/03 17:21:20 by mmoussou #+# #+# */
|
/* Created: 2025/02/03 17:21:20 by mmoussou #+# #+# */
|
||||||
/* Updated: 2025/02/03 18:11:27 by mmoussou ### ########.fr */
|
/* Updated: 2025/02/08 05:06:57 by mmoussou ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -16,17 +16,13 @@
|
|||||||
|
|
||||||
#include "requests/default.hpp"
|
#include "requests/default.hpp"
|
||||||
|
|
||||||
class HttpResponse {
|
class IHttpResponse {
|
||||||
public:
|
public:
|
||||||
HttpResponse(const HttpRequest &request);
|
void parseRequest(const HttpRequest &request) = 0;
|
||||||
HttpResponse(const HttpResponse &cpy);
|
|
||||||
~HttpResponse(void);
|
|
||||||
|
|
||||||
HttpResponse &operator=(const HttpResponse &cpy);
|
|
||||||
|
|
||||||
std::string str(void) const;
|
std::string str(void) const;
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
std::string _protocol;
|
std::string _protocol;
|
||||||
size_t _status_code;
|
size_t _status_code;
|
||||||
std::string _status_text;
|
std::string _status_text;
|
||||||
@ -35,4 +31,13 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class HttpGet: public IHttpResponse {
|
||||||
|
public:
|
||||||
|
HttpGet(void);
|
||||||
|
HttpGet(const HttpRequest &request);
|
||||||
|
~HttpResponse(void);
|
||||||
|
|
||||||
|
void parseRequest(const HttpRequest &request);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/02/03 17:28:31 by mmoussou #+# #+# */
|
/* Created: 2025/02/03 17:28:31 by mmoussou #+# #+# */
|
||||||
/* Updated: 2025/02/03 18:15:12 by mmoussou ### ########.fr */
|
/* Updated: 2025/02/04 15:18:26 by mmoussou ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -37,21 +37,10 @@ HttpResponse::HttpResponse(const HttpRequest &request): _protocol(request.protoc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HttpResponse::HttpResponse(const HttpResponse &cpy)
|
|
||||||
{
|
|
||||||
(void) cpy;
|
|
||||||
}
|
|
||||||
|
|
||||||
HttpResponse::~HttpResponse(void)
|
HttpResponse::~HttpResponse(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
HttpResponse &HttpResponse::operator=(const HttpResponse &cpy)
|
|
||||||
{
|
|
||||||
(void) cpy;
|
|
||||||
return (*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string HttpResponse::str(void) const
|
std::string HttpResponse::str(void) const
|
||||||
{
|
{
|
||||||
std::ostringstream response;
|
std::ostringstream response;
|
||||||
|
Reference in New Issue
Block a user