summaryrefslogtreecommitdiff
path: root/tests/libtest/lib516.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-11-11 23:11:04 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-11-11 23:11:04 +0000
commit59c063dfd38972e06a7f3a0b8f94860a67acdc96 (patch)
tree098346146ef5e14fe7cef289c6cdedae03ed2011 /tests/libtest/lib516.c
parent8c16696f4714bf65e86b6b51f247e9418338f39d (diff)
downloadcurl-59c063dfd38972e06a7f3a0b8f94860a67acdc96.tar.gz
Fix behaviour when passing NULL to CURLOPT_POSTFIELDS and CURLOPT_HTTPPOST.
Diffstat (limited to 'tests/libtest/lib516.c')
-rw-r--r--tests/libtest/lib516.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/libtest/lib516.c b/tests/libtest/lib516.c
new file mode 100644
index 000000000..6e71fb4bb
--- /dev/null
+++ b/tests/libtest/lib516.c
@@ -0,0 +1,23 @@
+#include "test.h"
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res=CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* First set the URL that is about to receive our POST. */
+ curl_easy_setopt(curl, CURLOPT_URL, URL);
+ curl_easy_setopt(curl, CURLOPT_HTTPPOST, NULL);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); /* show verbose for debug */
+ curl_easy_setopt(curl, CURLOPT_HEADER, 1); /* include header */
+
+ /* Now, we should be making a zero byte POST request */
+ res = curl_easy_perform(curl);
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ }
+ return (int)res;
+}