Refactor header status, reason, and target (API Change):

* header::result is a family of functions to replace header::status

* header interface now uses status enum and also ints

* reason-phrase is no longer stored unless the user explicitly
  requests it.

* When serializing, the standard reason is used for the
  corresponding status code unless the user has changed it.
This commit is contained in:
Vinnie Falco
2017-07-20 08:12:18 -07:00
parent 4f91e632bc
commit 3803c38dbd
30 changed files with 588 additions and 220 deletions
+3 -3
View File
@@ -292,7 +292,7 @@ public:
{
message<false, string_body, fields> m;
m.version = 10;
m.status = 200;
m.result(status::ok);
m.reason("OK");
m.fields.insert("Server", "test");
m.fields.insert("Content-Length", "5");
@@ -311,7 +311,7 @@ public:
{
message<false, string_body, fields> m;
m.version = 11;
m.status = 200;
m.result(status::ok);
m.reason("OK");
m.fields.insert("Server", "test");
m.fields.insert("Transfer-Encoding", "chunked");
@@ -786,7 +786,7 @@ public:
message<false, Body, fields> m0;
m0.version = 11;
m0.status = 200;
m0.result(status::ok);
m0.reason("OK");
m0.fields.insert("Server", "test");
m0.body.s = "Hello, world!\n";