diff options
author | Daniel Stenberg <daniel@haxx.se> | 2000-09-20 22:32:08 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2000-09-20 22:32:08 +0000 |
commit | 35aa363587f8169f9b1ceec22f5e8f8ebd9da91e (patch) | |
tree | 625d0d9c644eac798d0d15d27ee15780e70061a5 /docs/examples/simple.c | |
parent | 7eafb0f3256d7842fc808268a72105c93cdcdfc0 (diff) | |
download | curl-35aa363587f8169f9b1ceec22f5e8f8ebd9da91e.tar.gz |
new libcurl example code stuff
Diffstat (limited to 'docs/examples/simple.c')
-rw-r--r-- | docs/examples/simple.c | 26 |
1 files changed, 26 insertions, 0 deletions
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 <stdio.h> + +#include <curl/curl.h> +#include <curl/types.h> +#include <curl/easy.h> + +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; +} |