Http: add debug print

This commit is contained in:
Lion Kortlepel 2021-08-09 13:36:16 +02:00 committed by Lion
parent ce834a634c
commit 9237f0dd43

View File

@ -123,9 +123,13 @@ std::string Http::POST(const std::string& host, const std::string& target, const
beast::flat_buffer buffer;
http::response<http::string_body> response;
auto BackendName = response.base().find("Date");
auto BackendName = response.base().find("BeamMP-Endpoint");
if (BackendName != response.base().end()) {
Application::Console().Write("HTTP POST: Date is " + std::string(BackendName->value()));
Application::Console().Write("HTTP POST: BeamMP-Endpoint is " + std::string(BackendName->value()));
} else {
for (const auto& header : response.base()) {
Application::Console().Write(header.name_string().data() + std::string(" = ") + std::string(header.value()));
}
}
http::read(stream, buffer, response);