]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/curl/docs/examples/persistant.c
hello world
[icculus/iodoom3.git] / neo / curl / docs / examples / persistant.c
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
11 #include <stdio.h>
12 #include <unistd.h>
13 #include <curl/curl.h>
14
15 int main(int argc, char **argv)
16 {
17   CURL *curl;
18   CURLcode res;
19
20   curl_global_init(CURL_GLOBAL_ALL);
21
22   curl = curl_easy_init();
23   if(curl) {
24     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
25     curl_easy_setopt(curl, CURLOPT_HEADER, 1);
26
27     /* get the first document */
28     curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/");
29     res = curl_easy_perform(curl);
30
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);
35
36     /* always cleanup */
37     curl_easy_cleanup(curl);
38   }
39
40   return 0;
41 }