HTTP now automatically encodes jsonvalue content

This commit is contained in:
2022-06-07 01:54:08 -04:00
parent 779d9e20b8
commit 79b84a588a
9 changed files with 191 additions and 61 deletions

View File

@@ -219,6 +219,7 @@ public:
HttpChannel &channel = http_client_channels_[request.request_id()];
if (channel.channel_ == nullptr) {
channel.channel_ = new_outgoing_channel(request.target());
channel.method_ = request.method();
channel.parsed_bytes_ = 0;
request.send(channel.channel_->out());
}
@@ -235,7 +236,7 @@ public:
response.fail(503, util::ss("Service Unavailable: ", channel.error()));
} else {
htchan.parsed_bytes_ = channel.in()->fill();
response.parse_response(channel.in()->view(), channel.closed());
response.parse_response(channel.in()->view(), channel.closed(), htchan.method_);
}
if (response.complete()) {
response.set_request_id(pair.first);