Refactor http::header contents (API Change):

fix #124

The http::header data members "method", "url", and "reason"
are changed from data members, to pairs of get and set
functions which forward the call to the Fields type used
to instantiate the template.

Previously, these data members were implemented using
std::string. With this change, the implementation of the
Fields type used to instantiate the template is now in
control of the representation of those values. This permits
custom memory allocation strategies including uniform use of
the Allocator type already provided to beast::http::basic_fields.
This commit is contained in:
Vinnie Falco
2017-05-02 15:49:22 -07:00
parent dd02097d26
commit ff5e659545
30 changed files with 319 additions and 213 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ int main()
// Send HTTP request using beast
beast::http::request<beast::http::string_body> req;
req.method = "GET";
req.url = "/";
req.method("GET");
req.target("/");
req.version = 11;
req.fields.replace("Host", host + ":" +
boost::lexical_cast<std::string>(sock.remote_endpoint().port()));