- struct ucontent chunk;
- json_object *obj;
-
- obj = NULL;
-
- chunk.data = malloc(1);
- chunk.len = 0;
-
- curl_easy_setopt(curl, CURLOPT_URL, url);
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 0);
- if (body) {
- curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body);
- curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(body));
+ const char *in;
+ char *out;
+ struct json_object *result;
+
+ in = json_object_to_json_string(j);
+ out = http_get(url, in);
+
+ 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;