-json_object *get_json_object(const char *url)
-{
- struct ucontent chunk;
- json_object *obj;
-
- obj = NULL;
-
- if (!curl)
- return NULL;
-
- chunk.data = malloc(1);
- chunk.len = 0;
-
- curl_easy_setopt(curl, CURLOPT_URL, url);
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 0);
- curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl);
- curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);
-
- if (curl_easy_perform(curl) == CURLE_OK)
- obj = json_tokener_parse(chunk.data);
- else
- fprintf(stderr, _("Fail to connect to: %s"), url);
-
- free(chunk.data);
-
- return obj;
-}
-
-static json_object *post(const char *url, const char *body)