🏗️」 wip: work in progress, not done yet.

This commit is contained in:
y-syo
2025-02-11 07:41:56 +01:00
parent d7baf04e5f
commit 935de681d9
2 changed files with 14 additions and 20 deletions

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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"
class HttpResponse {
class IHttpResponse {
public:
HttpResponse(const HttpRequest &request);
HttpResponse(const HttpResponse &cpy);
~HttpResponse(void);
HttpResponse &operator=(const HttpResponse &cpy);
void parseRequest(const HttpRequest &request) = 0;
std::string str(void) const;
private:
protected:
std::string _protocol;
size_t _status_code;
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

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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::operator=(const HttpResponse &cpy)
{
(void) cpy;
return (*this);
}
std::string HttpResponse::str(void) const
{
std::ostringstream response;