api - HTTP request with C & curl -


#include <stdio.h>    #include <curl/curl.h>  int main(void) {     curl *curl;     curlcode res;      curl_global_init(curl_global_all);      curl = curl_easy_init();      if(curl) {         curl_easy_setopt(curl, curlopt_url, "http://api.adf.ly/api.php?");         curl_easy_setopt(curl, curlopt_postfields,                       "key=6xxxx&uid=41xxxxx&advert_type=int\                            &domain=adf.ly&url=http://somewebsite.com/2");          res = curl_easy_perform(curl);         if(res != curle_ok)             fprintf(stderr, "curl_easy_perform() failed: %s\n",                  curl_easy_strerror(res));          curl_easy_cleanup(curl);      }       curl_global_cleanup();       return 0;    } 

i trying create short link above api adf.ly above code doesn't add new adf.ly links please note, key , user id correct, blanked them out

also there way copy output html request?


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -