1 /*****************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
17 CURLcode res=CURLE_OK;
19 if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
20 fprintf(stderr, "curl_global_init() failed\n");
21 return TEST_ERR_MAJOR_BAD;
24 if ((curl = curl_easy_init()) == NULL) {
25 fprintf(stderr, "curl_easy_init() failed\n");
26 curl_global_cleanup();
27 return TEST_ERR_MAJOR_BAD;
30 /* First set the URL that is about to receive our POST. */
31 test_setopt(curl, CURLOPT_URL, URL);
32 test_setopt(curl, CURLOPT_POSTFIELDS, NULL);
33 test_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L);
34 test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
35 test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
37 /* Now, we should be making a zero byte POST request */
38 res = curl_easy_perform(curl);
43 curl_easy_cleanup(curl);
44 curl_global_cleanup();