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 02d4086061
commit a52914175b
29 changed files with 319 additions and 213 deletions

View File

@@ -35,8 +35,8 @@ int main()
// Send HTTP request over SSL 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.insert("Host", host + ":" +
boost::lexical_cast<std::string>(sock.remote_endpoint().port()));