summaryrefslogtreecommitdiff
path: root/docs/examples/https.c
diff options
context:
space:
mode:
authorGuenter Knauf <lists@gknw.net>2012-07-04 17:03:52 +0200
committerGuenter Knauf <lists@gknw.net>2012-07-04 17:03:52 +0200
commita3dbbcfd2ac7ab8f597e26e76935726279d3fa0c (patch)
tree10019b38cc070abd7e9b781761b0e9f27f6ffeea /docs/examples/https.c
parent6388ac7dc1f531f4f94616e8e0a46a0cecde8315 (diff)
downloadgnurl-a3dbbcfd2ac7ab8f597e26e76935726279d3fa0c.tar.gz
gnurl-a3dbbcfd2ac7ab8f597e26e76935726279d3fa0c.tar.bz2
gnurl-a3dbbcfd2ac7ab8f597e26e76935726279d3fa0c.zip
Added error checking for samples.
Diffstat (limited to 'docs/examples/https.c')
-rw-r--r--docs/examples/https.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/examples/https.c b/docs/examples/https.c
index 984357e37..8bfd90cac 100644
--- a/docs/examples/https.c
+++ b/docs/examples/https.c
@@ -55,7 +55,12 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
#endif
+ /* 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);