X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/f27c218d18ebf7198e07249aca1eed625da914fd..9075115540d133ca048025e719884121007b9e87:/Server/include/plaqui/server/httpresponse.h?ds=sidebyside diff --git a/Server/include/plaqui/server/httpresponse.h b/Server/include/plaqui/server/httpresponse.h index bc8f900..09ff21d 100644 --- a/Server/include/plaqui/server/httpresponse.h +++ b/Server/include/plaqui/server/httpresponse.h @@ -30,6 +30,7 @@ #include "plaqui/server/httperror.h" #include "plaqui/server/httpmessage.h" +#include #include namespace PlaQui { @@ -39,6 +40,7 @@ namespace Server { /// Respuesta HTTP. class HTTPResponse: public HTTPMessage { + ///////////////////////////////////////////////////////////////////// // Tipos. public: @@ -50,9 +52,11 @@ namespace Server { MISSING_HTTP_RESPONSE_CODE } Error; + ///////////////////////////////////////////////////////////////////// // Atributos. - protected: + //protected: FIXME - hacer privado con get/set? + public: /// Código de estado. unsigned status_code; @@ -60,6 +64,7 @@ namespace Server { /// Descripción del código (razón). std::string reason; + ///////////////////////////////////////////////////////////////////// // Métodos. public: @@ -72,7 +77,8 @@ namespace Server { /** * Constructor. */ - HTTPResponse(const std::string& version = "1.1"); + HTTPResponse(const std::string& body = "", + const std::string& version = "1.1"); /** * Constructor. @@ -95,13 +101,14 @@ namespace Server { * Obtiene los datos de la respuesta HTTP desde un texto. */ friend std::istream& operator>>(std::istream& is, - HTTPResponse& resp) throw(Error, std::ios::failure); + HTTPResponse& resp) + throw(Error, sockerr, std::ios::failure); /** * Convierte la respuesta HTTP en texto. */ friend std::ostream& operator<<(std::ostream& os, - const HTTPResponse& resp); + const HTTPResponse& resp) throw(sockerr); };