diff options
Diffstat (limited to 'docs/examples/simple.c')
-rw-r--r-- | docs/examples/simple.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/examples/simple.c b/docs/examples/simple.c new file mode 100644 index 0000000..351cf72 --- /dev/null +++ b/docs/examples/simple.c @@ -0,0 +1,27 @@ +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + */ + +#include <stdio.h> +#include <curl/curl.h> + +int main(void) +{ + CURL *curl; + CURLcode res; + + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); + res = curl_easy_perform(curl); + + /* always cleanup */ + curl_easy_cleanup(curl); + } + return 0; +} |