#ifdef DEBUG_HTTP
int my_trace(CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
{
- const char *text;
(void) handle;
(void) userp;
std::unique_ptr<CURL, void(*)(CURL *)> scoped(curl_easy_init(), curl_easy_cleanup);
if (scoped == nullptr)
throw std::runtime_error("Failed to curl_easy_init");
-
+
CURL *handle = scoped.get();
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, "Content-Type: application/json");
if (headers == nullptr)
throw std::runtime_error("Failed to curl_slist_append for headers");
-
+
std::unique_ptr<struct curl_slist, void(*)(struct curl_slist *)> scoped2(
headers, curl_slist_free_all);