Improved write buffering in JSONRPC client

This commit is contained in:
Vinnie Falco
2016-03-07 17:03:33 -05:00
parent 29a4849024
commit 79ce5901f3

View File

@@ -110,16 +110,14 @@ public:
using namespace boost::asio;
using namespace std::string_literals;
std::string r;
r =
auto const r =
"POST / HTTP/1.1\r\n"
"Host: me\r\n"
"Connection: Keep-Alive\r\n"s +
"Content-Type: application/json; charset=UTF-8\r\n"s +
"Content-Length: " + std::to_string(s.size()) + "\r\n"
"\r\n";
"\r\n" + s;
write(stream_, buffer(r));
write(stream_, buffer(s));
read_until(stream_, bin_, "\r\n\r\n");
beast::asio::streambuf body;