Refactor header and message constructors:

fix #581

* request and response headers now have convenience
  constructors so important fields like method, target,
  result, and version may be set upon construction.

Actions Required:

* Evaluate each message constructor call site and
  adjust the constructor argument list as needed.
This commit is contained in:
Vinnie Falco
2017-07-20 08:15:29 -07:00
parent 2ee088de5f
commit b0e52dd246
11 changed files with 487 additions and 210 deletions
+1 -4
View File
@@ -48,10 +48,7 @@ int main()
return fail("connect", ec);
// Set up an HTTP GET request message
http::request<http::string_body> req;
req.method(http::verb::get);
req.target("/");
req.version = 11;
http::request<http::string_body> req{http::verb::get, "/", 11};
req.set(http::field::host, host + ":" +
std::to_string(sock.remote_endpoint().port()));
req.set(http::field::user_agent, BEAST_VERSION_STRING);