persistant.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*****************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * $Id: persistant.c,v 1.2 2003/11/19 08:20:13 bagder Exp $
  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, 1);
  21. curl_easy_setopt(curl, CURLOPT_HEADER, 1);
  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. }