C

C - Libcurl

1
CURL *hnd = curl_easy_init();
2
3
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
4
curl_easy_setopt(hnd, CURLOPT_URL, "https://pickyassist.com/app/api/v2/push");
5
6
struct curl_slist *headers = NULL;
7
headers = curl_slist_append(headers, "content-type: application/json");
8
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
9
10
11
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"token\":\"c2a0b6221c5dd55ceb09ae1f74e46521756d\",\"priority \":0,\"application\":\"2\",\"sleep\":0,\"globalmessage\":\"\",\"globalmedia\":\"\",\"data\":[{\"number\":\"1212\",\"message\":\"Test\"}]}");
12
13
CURLcode ret = curl_easy_perform(hnd);
Copied!
Last modified 2yr ago
Copy link