X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/ffe5447aa2d71b5296cbdd36c48d5f9d59e249af..7e74b790d290cd7d776349503bb361c47933c01f:/Server/include/plaqui/server/httprequest.h diff --git a/Server/include/plaqui/server/httprequest.h b/Server/include/plaqui/server/httprequest.h index ace04f0..5f0757e 100644 --- a/Server/include/plaqui/server/httprequest.h +++ b/Server/include/plaqui/server/httprequest.h @@ -28,7 +28,9 @@ #ifndef PLAQUI_HTTPREQUEST_H #define PLAQUI_HTTPREQUEST_H -#include "httpmessage.h" +#include "plaqui/server/httperror.h" +#include "plaqui/server/httpmessage.h" +#include #include #include #include @@ -109,18 +111,25 @@ namespace Server { HTTPRequest(const std::string& uri = "/", const HTTPMethod& method = GET, const std::string& query = "", + const std::string& body = "", const std::string& version = "1.1"); + /** + * Obtiene el método como un string. + */ + std::string method_str(void) const; + /** * Obtiene los datos del pedido HTTP desde un texto. */ - friend std::istream& operator>>(std::istream& is, HTTPRequest& req); + friend std::istream& operator>>(std::istream& is, HTTPRequest& req) + throw(HTTPError, sockerr, std::ios::failure); /** * Convierte el pedido HTTP en texto. */ friend std::ostream& operator<<(std::ostream& os, - const HTTPRequest& req); + const HTTPRequest& req) throw(sockerr); };