diff --git a/src/rum/http/request.cpp b/src/rum/http/request.cpp index 7d9f11e..3830c44 100644 --- a/src/rum/http/request.cpp +++ b/src/rum/http/request.cpp @@ -2,6 +2,8 @@ #include #if __cplusplus >= 202302L #include +#else +#include #endif #include #include @@ -19,7 +21,15 @@ Request::operator std::string() const { cookie_string += "\t\t'" + cookie.first + "': '" + cookie.second + "'\n"; } #if __cplusplus < 202302L - return ""; + std::stringstream text; + text << "Request{{\n" + << "\tmethod: " << method << "\n" + << "\t" << (std::string)uri << "\n" + << "\theaders: \n" + << headers_string << "\tcookies: \n" + << cookie_string << "\tbody: '" << body << "'\n}}"; + + return text.str(); #else return std::vformat( "Request{{\n" diff --git a/src/rum/http/uri.cpp b/src/rum/http/uri.cpp index d91360b..1e30a6b 100644 --- a/src/rum/http/uri.cpp +++ b/src/rum/http/uri.cpp @@ -2,8 +2,11 @@ #include #include #include +#include #if __cplusplus >= 202302L #include +#else +#include #endif #include @@ -15,7 +18,18 @@ URI::operator std::string() const { query += "\t\t'" + param.first + "': '" + param.second + "'\n"; } #if __cplusplus < 202302L - return ""; + std::stringstream text; + text << "URI{{" + << "\n\tscheme: '" << scheme << "'" + << "\n\tuser: '" << user << "'" + << "\n\tpassword: '" << password << "'" + << "\n\thost: '" << host << "'" + << "\n\tport: '" << port << "'" + << "\n\tpath: '" << path << "'" + << "\n\tquery: \n" + << query << "\n\tfragment: '" << fragment << "'\n}}"; + + return text.str(); #else return std::vformat( "URI{{"