X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/cd6078479123cd2cfe62df2d838633c143649edf..d940cfcd9606fbf7fc82376260f3a63573fd3795:/Server/include/plaqui/server/httpmessage.h?ds=sidebyside diff --git a/Server/include/plaqui/server/httpmessage.h b/Server/include/plaqui/server/httpmessage.h index cd583e7..b188e19 100644 --- a/Server/include/plaqui/server/httpmessage.h +++ b/Server/include/plaqui/server/httpmessage.h @@ -28,6 +28,7 @@ #ifndef PLAQUI_HTTPMESSAGE_H #define PLAQUI_HTTPMESSAGE_H +#include "plaqui/server/httpheaders.h" #include namespace PlaQui { @@ -39,17 +40,21 @@ namespace Server { // Atributos. + private: + + /// Cuerpo del mensaje. + std::string body; + protected: /// Version HTTP. std::string version; + public: + /// Cabeceras HTTP. HTTPHeaders headers; - /// Cuerpo del mensaje. - std::string body; - // Métodos. public: @@ -67,14 +72,25 @@ namespace Server { /** * Constructor. */ - HTTPMessage(const std::string& body, - const std::string& http_version = "1.1"); + //HTTPMessage(const std::string& body, + // const std::string& http_version = "1.1"); + + /** + * Obtiene el cuerpo del mensaje. + */ + const std::string& get_body(void) const; + + /** + * Establece el cuerpo del mensaje. + * + * \param _body Cuerpo del mensaje. + */ + void set_body(const std::string& _body); /** * Obtiene los datos del pedido HTTP desde un texto. */ - friend std::istream& operator>>(std::istream& is, - const HTTPMessage& m); + friend std::istream& operator>>(std::istream& is, HTTPMessage& m); /** * Convierte el pedido HTTP en texto.