mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-06-17 22:23:03 +00:00
add try/catch to PostHTTP
This commit is contained in:
@@ -71,7 +71,7 @@ std::string HttpRequest(const std::string& host, int port, const std::string& ta
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string PostHTTP(const std::string& host, const std::string& target, const std::unordered_map<std::string, std::string>& fields, const std::string& body, bool json) {
|
std::string PostHTTP(const std::string& host, const std::string& target, const std::unordered_map<std::string, std::string>& fields, const std::string& body, bool json) {
|
||||||
//try {
|
try {
|
||||||
net::io_context io;
|
net::io_context io;
|
||||||
|
|
||||||
// The SSL context is required, and holds certificates
|
// The SSL context is required, and holds certificates
|
||||||
@@ -154,8 +154,8 @@ std::string PostHTTP(const std::string& host, const std::string& target, const s
|
|||||||
debug("POST " + host + target + ": " + debug_response_str);
|
debug("POST " + host + target + ": " + debug_response_str);
|
||||||
return std::string(response.body());
|
return std::string(response.body());
|
||||||
|
|
||||||
/*} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
error(e.what());
|
error(e.what());
|
||||||
return "-1";
|
return "-1";
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user