X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/6bffb655ac989fe4f115763270f84175bf24e4bb..1855f998e5c0e51e2c1958724ac84cc13a87d84c:/Server/include/plaqui/server/httpresponse.h diff --git a/Server/include/plaqui/server/httpresponse.h b/Server/include/plaqui/server/httpresponse.h index 462c082..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,6 +52,7 @@ namespace Server { MISSING_HTTP_RESPONSE_CODE } Error; + ///////////////////////////////////////////////////////////////////// // Atributos. //protected: FIXME - hacer privado con get/set? @@ -61,6 +64,7 @@ namespace Server { /// Descripción del código (razón). std::string reason; + ///////////////////////////////////////////////////////////////////// // Métodos. public: @@ -73,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. @@ -96,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); };