Commit 7c5ac289 authored by octal's avatar octal

Client: now writing the request payload in the buffer

parent 5589f62c
...@@ -109,6 +109,7 @@ namespace { ...@@ -109,6 +109,7 @@ namespace {
auto res = request.resource(); auto res = request.resource();
auto s = splitUrl(res); auto s = splitUrl(res);
auto body = request.body();
auto host = s.first; auto host = s.first;
auto path = s.second; auto path = s.second;
...@@ -122,8 +123,15 @@ namespace { ...@@ -122,8 +123,15 @@ namespace {
if (!writeHeader<Header::UserAgent>(os, UA)) return false; if (!writeHeader<Header::UserAgent>(os, UA)) return false;
if (!writeHeader<Header::Host>(os, host.toString())) return false; if (!writeHeader<Header::Host>(os, host.toString())) return false;
if (!body.empty()) {
if (!writeHeader<Header::ContentLength>(os, body.size())) return false;
}
OUT(os << crlf); OUT(os << crlf);
if (!body.empty()) {
OUT(os << body);
}
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment