I tried the curl command provided on the page, which works.
Here is the sample code that doesn’t work. Executing the below mentioned program results in a hangup when curl_easy_perform() call is made.
char *dbname = “test1”;
sprintf (url, “http://localhost:8086/query?q=CREATE+DATABASE+%s”,dbname);
/* get a curl handle */
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt (curl, CURLOPT_POST, 1L);
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
/* always cleanup */
Could you provide your feedback/input on why this request doesn’t work?