Advertisement
Guest User

Untitled

a guest
Jan 20th, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <curl/curl.h>
  3. #include <curl/easy.h>
  4.  
  5. static long send_request(CURL *curl)
  6. {
  7.   long response = -1;
  8.   curl_easy_setopt(curl, CURLOPT_URL, "https://storage101.dfw1.clouddrive.com/");
  9.   curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
  10.   curl_easy_perform(curl);
  11.   curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response);
  12.   curl_easy_reset(curl);
  13.   return response;
  14. }
  15.  
  16. int main(int argc, char **argv)
  17. {
  18.   CURL *handle = curl_easy_init();
  19.   printf("Initial request: %ld\n", send_request(handle));
  20.   printf("Second request: %ld\n", send_request(handle));
  21.   return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement