C (Curl)

ThingsOn HTTP API / C

C programlama dilini kullanarak platformdan veri sorgulamak için aşağıdaki örneği kullanabilirsiniz.

Bu örnekte LibCurl kullanılmıştır: https://curl.haxx.se/libcurl/c/

Read
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://cloud.thingson.io:8086/query?db=[DB_NAME]&q=[QUERY]");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Basic [API_KEY]");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);