Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / docs / examples / persistant.c
blob8b2bfb1af6bd28e3c1fdafbbe8df977cfe21bc45
1 /*****************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * $Id: persistant.c,v 1.1.1.1 2008-09-23 16:32:05 hoffman Exp $
9 */
11 #include <stdio.h>
12 #include <unistd.h>
13 #include <curl/curl.h>
15 int main(int argc, char **argv)
17 CURL *curl;
18 CURLcode res;
20 curl_global_init(CURL_GLOBAL_ALL);
22 curl = curl_easy_init();
23 if(curl) {
24 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
25 curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
27 /* get the first document */
28 curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/");
29 res = curl_easy_perform(curl);
31 /* get another document from the same server using the same
32 connection */
33 curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/docs/");
34 res = curl_easy_perform(curl);
36 /* always cleanup */
37 curl_easy_cleanup(curl);
40 return 0;