persistant.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*****************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * $Id$
  9. */
  10. #include <stdio.h>
  11. #include <unistd.h>
  12. #include <curl/curl.h>
  13. int main(int argc, char **argv)
  14. {
  15. CURL *curl;
  16. CURLcode res;
  17. curl_global_init(CURL_GLOBAL_ALL);
  18. curl = curl_easy_init();
  19. if(curl) {
  20. curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
  21. curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
  22. /* get the first document */
  23. curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/");
  24. res = curl_easy_perform(curl);
  25. /* get another document from the same server using the same
  26. connection */
  27. curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/docs/");
  28. res = curl_easy_perform(curl);
  29. /* always cleanup */
  30. curl_easy_cleanup(curl);
  31. }
  32. return 0;
  33. }