JSON-RPC curl, doesn't return a json object?

2018-02-23 01:20:26

Hello guys so I tried to create a POST request t a pool using this code





int GetWorkFromPool()


/** Post a requet on the pool **/


//------ variables

int respOnPost;

char *bData = "{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getinfo\", \"params\": [] }";

struct curl_slist *header = NULL;

// InitialiE curl

CURL *hcurl = curl_easy_init();

curl_easy_setopt(hcurl, CURLOPT_URL, "http:pool.supportxmr.com");

curl_easy_setopt(hcurl, CURLOPT_POST, 1); // We post a request on the pool, but before that we should put more variables

curl_easy_setopt(hcurl, CURLOPT_POSTFIELDSIZE, (long) strlen(bData));

curl_easy_setopt(hcurl, CURLOPT_POSTFIELDS, bData);

header = curl_slist_append(header, "Content-Type:application/json");

curl_easy_setopt(hcurl, CURLOPT_HTTPHEADER, header);