From 35aa363587f8169f9b1ceec22f5e8f8ebd9da91e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 20 Sep 2000 22:32:08 +0000 Subject: new libcurl example code stuff --- docs/examples/simple.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 docs/examples/simple.c (limited to 'docs/examples/simple.c') diff --git a/docs/examples/simple.c b/docs/examples/simple.c new file mode 100644 index 000000000..e6138c4e1 --- /dev/null +++ b/docs/examples/simple.c @@ -0,0 +1,26 @@ +#include + +#include +#include +#include + +int main(int argc, char **argv) +{ + CURL *curl; + CURLcode res; + FILE *headerfile; + + headerfile = fopen("dumpit", "w"); + + curl = curl_easy_init(); + if(curl) { + /* what call to write: */ + curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se"); + curl_easy_setopt(curl, CURLOPT_WRITEHEADER, headerfile); + res = curl_easy_perform(curl); + + /* always cleanup */ + curl_easy_cleanup(curl); + } + return 0; +} -- cgit v1.2.3