reformat all

This commit is contained in:
Lion Kortlepel
2020-12-23 23:34:30 +01:00
parent 0f4c08c068
commit a944565fb9
13 changed files with 171 additions and 147 deletions

View File

@@ -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);