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
+2 -1
View File
@@ -27,10 +27,11 @@ public:
{
static_assert(is_body_reader<string_view_body>::value, "");
static_assert(! is_body_writer<string_view_body>::value, "");
request<string_view_body> req{"Hello, world!"};
request<string_view_body> req;
req.version = 11;
req.method(verb::post);
req.target("/");
req.body = "Hello, world!";
req.prepare_payload();
static_buffer_n<512> b;
ostream(b) << req;