mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 06:46:23 +00:00
reformat all
This commit is contained in:
@@ -33,7 +33,7 @@ std::string HttpRequest(const std::string& IP, int port) {
|
||||
}
|
||||
|
||||
std::string PostHTTP(const std::string& IP, const std::string& Fields, bool json) {
|
||||
static auto *header = new curl_slist{(char*)"Content-Type: application/json"};
|
||||
static auto* header = new curl_slist { (char*)"Content-Type: application/json" };
|
||||
static std::mutex Lock;
|
||||
std::scoped_lock Guard(Lock);
|
||||
CURL* curl;
|
||||
@@ -43,7 +43,8 @@ std::string PostHTTP(const std::string& IP, const std::string& Fields, bool json
|
||||
Assert(curl);
|
||||
if (curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, IP.c_str());
|
||||
if(json)curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header);
|
||||
if (json)
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header);
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, Fields.size());
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, Fields.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
|
||||
|
||||
Reference in New Issue
Block a user