aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/httpcustomheader.c
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/httpcustomheader.c')
-rw-r--r--docs/examples/httpcustomheader.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/examples/httpcustomheader.c b/docs/examples/httpcustomheader.c
index 077df2164..5c013750f 100644
--- a/docs/examples/httpcustomheader.c
+++ b/docs/examples/httpcustomheader.c
@@ -38,10 +38,18 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_URL, "localhost");
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl);
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
/* redo request with our own custom Accept: */
res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
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);