aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/simple.c')
-rw-r--r--docs/examples/simple.c26
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;
+}