Remove dynamic exceptions
[anna.git] / source / http / Request.cpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #include <anna/config/defines.hpp>
10
11 #include <anna/http/Request.hpp>
12
13 using namespace std;
14 using namespace anna;
15
16 string http::Request::codeStartLine() const
17 noexcept(false) {
18   if(a_uri == "")
19     throw RuntimeException("URI must have a value", ANNA_FILE_LOCATION);
20
21   string result(Method::Type::asCString(a_method));
22   result += ' ';
23   result += a_uri;
24   result += ' ';
25   return result += getVersion();
26 }
27
28 string http::Request::asString() const
29 {
30   string result("http::Request { ");
31   result += Method::asString(a_method);
32   result += " | URI: ";
33   result += a_uri;
34   result += " | Version: ";
35   result += getVersion();
36   return result += " }";
37 }
38