2025-02-03 18:39:23 +01:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* HttpResponse.hpp :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2025/02/03 17:21:20 by mmoussou #+# #+# */
|
2025-02-12 01:36:19 +01:00
|
|
|
/* Updated: 2025/02/12 00:50:47 by mmoussou ### ########.fr */
|
2025-02-03 18:39:23 +01:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
#pragma once
|
2025-02-11 13:52:45 +01:00
|
|
|
#ifndef __WEBSERV_REQUESTS_HTTP_RESPONSE_HPP__
|
|
|
|
# define __WEBSERV_REQUESTS_HTTP_RESPONSE_HPP__
|
2025-02-03 18:39:23 +01:00
|
|
|
|
2025-02-12 01:36:19 +01:00
|
|
|
#include <sstream>
|
|
|
|
|
2025-02-11 22:26:50 +01:00
|
|
|
#include <requests/HttpIMessage.hpp>
|
2025-02-03 18:39:23 +01:00
|
|
|
|
2025-02-11 13:52:45 +01:00
|
|
|
namespace webserv {
|
|
|
|
namespace http {
|
2025-02-03 18:39:23 +01:00
|
|
|
|
2025-02-11 13:52:45 +01:00
|
|
|
class Response: public http::IMessage {
|
|
|
|
public:
|
|
|
|
Response(void);
|
|
|
|
|
|
|
|
std::string getProtocol(void) const;
|
|
|
|
size_t getStatusCode(void) const;
|
|
|
|
std::string getStatusText(void) const;
|
|
|
|
|
|
|
|
void setProtocol(std::string const protocol);
|
|
|
|
void setStatusCode(size_t const status_code);
|
|
|
|
void setStatusText(std::string const status_text);
|
|
|
|
|
2025-02-11 22:26:50 +01:00
|
|
|
std::string str(void) const;
|
|
|
|
|
2025-02-11 13:52:45 +01:00
|
|
|
private:
|
2025-02-12 01:36:19 +01:00
|
|
|
std::string _protocol;
|
|
|
|
size_t _status_code;
|
|
|
|
std::string _status_text;
|
2025-02-03 18:39:23 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2025-02-11 13:52:45 +01:00
|
|
|
} // -namespace http
|
|
|
|
} // -namespace webserv
|
2025-02-11 07:41:56 +01:00
|
|
|
|
2025-02-11 13:52:45 +01:00
|
|
|
#endif // __WEBSERV_REQUESTS_HTTP_RESPONSE_HPP__
|