diff options
Diffstat (limited to 'docs/examples/postit2.c')
-rw-r--r-- | docs/examples/postit2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/examples/postit2.c b/docs/examples/postit2.c index 63c248467..67dcc1330 100644 --- a/docs/examples/postit2.c +++ b/docs/examples/postit2.c @@ -83,7 +83,13 @@ int main(int argc, char *argv[]) /* only disable 100-continue header if explicitly requested */ curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); + + /* 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); |