Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. CURL *hnd = curl_easy_init();
  2.  
  3. curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
  4. curl_easy_setopt(hnd, CURLOPT_URL, "https://partamon-api.herokuapp.com/sync/weather_station");
  5.  
  6. struct curl_slist *headers = NULL;
  7. headers = curl_slist_append(headers, "Postman-Token: d77a9591-e5e3-4dbf-aeb5-d9205ce767c1");
  8. headers = curl_slist_append(headers, "Cache-Control: no-cache");
  9. headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
  10. curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
  11.  
  12. curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "parametro=valor_parametro_aqui");
  13.  
  14. CURLcode ret = curl_easy_perform(hnd);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement