#include "http.h"
-static int debug = 1;
+static int debug;
struct ucontent {
char *data;
if (content) {
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, content);
curl_easy_setopt(curl,
- CURLOPT_POSTFIELDSIZE,
+ CURLOPT_POSTFIELDSIZE,
(long)strlen(content));
}
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl);
if (debug)
printf("HTTP request= %s\n",
json_object_to_json_string(j));
-
+
if (out) {
result = json_tokener_parse(out);
if (debug)
printf("HTTP reply= %s\n", out);
free(out);
return result;
- }
+ }
return NULL;
}