diff options
Diffstat (limited to 'docs/examples/simple.c')
-rw-r--r-- | docs/examples/simple.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/examples/simple.c b/docs/examples/simple.c index 55877f8b2..cb23b7ae3 100644 --- a/docs/examples/simple.c +++ b/docs/examples/simple.c @@ -30,7 +30,13 @@ int main(void) curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); + + /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); + /* Check for errors */ + if(res != CURLE_OK) + fprintf(stderr, "curl_easy_perform() failed: %s\n", + curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); |