diff options
Diffstat (limited to 'docs/examples/simplepost.c')
-rw-r--r-- | docs/examples/simplepost.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/examples/simplepost.c b/docs/examples/simplepost.c index 3c8571919..8657771f4 100644 --- a/docs/examples/simplepost.c +++ b/docs/examples/simplepost.c @@ -39,7 +39,12 @@ int main(void) itself */ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(postthis)); + /* 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); |