curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0);
- curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body);
- curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(body));
+ if (body) {
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body);
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(body));
+ }
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);