add api-v header to heartbeat post

This commit is contained in:
Lion Kortlepel
2022-01-20 16:09:08 +01:00
parent c42c748b37
commit cd4129e05d
2 changed files with 55 additions and 16 deletions

View File

@@ -36,10 +36,11 @@ std::string Http::GET(const std::string& host, int port, const std::string& targ
std::string Http::POST(const std::string& host, int port, const std::string& target, const std::string& body, const std::string& ContentType, unsigned int* status, const httplib::Headers& headers) {
httplib::SSLClient client(host, port);
client.set_read_timeout(std::chrono::seconds(10));
beammp_assert(client.is_valid());
client.enable_server_certificate_verification(false);
client.set_address_family(AF_INET);
auto res = client.Post(target.c_str(), body.c_str(), body.size(), ContentType.c_str());
auto res = client.Post(target.c_str(), headers, body.c_str(), body.size(), ContentType.c_str());
if (res) {
if (status) {
*status = res->status;