summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-07-13 09:58:29 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-07-14 17:53:45 +0200
commitf5e6907d5232ca9c05cb8a0b99d809590ddcde18 (patch)
treeca196f63279e191890bc0feb5a3ba510ce59cc84 /tests
parentd75e3ab74c91eff67363cba064611d405105a12f (diff)
downloadcurl-f5e6907d5232ca9c05cb8a0b99d809590ddcde18.tar.gz
curl: add %{method} to the -w variables
Gets the CURLINFO_EFFECTIVE_METHOD from libcurl. Added test 1197 to verify.
Diffstat (limited to 'tests')
-rw-r--r--tests/data/Makefile.inc2
-rw-r--r--tests/data/test119788
-rw-r--r--tests/data/test9702
3 files changed, 90 insertions, 2 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index eaf347d91..667d7951a 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -141,7 +141,7 @@ test1168 \
test1170 test1171 test1172 test1173 test1174 test1175 test1176 test1177 \
test1178 test1179 \
\
-test1190 test1191 test1192 test1193 test1194 test1195 test1196 \
+test1190 test1191 test1192 test1193 test1194 test1195 test1196 test1197 \
\
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \
diff --git a/tests/data/test1197 b/tests/data/test1197
new file mode 100644
index 000000000..96d368f8b
--- /dev/null
+++ b/tests/data/test1197
@@ -0,0 +1,88 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+--write-out
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Content-Type: text/plain
+Location: ./11970001
+
+monster
+</data>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 15
+Connection: close
+Content-Type: text/plain; charset=us-ascii
+
+bigger monster
+</data1>
+
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST redirected to GET and --write-out method
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1197 -w "%{method}\n" -L -d "twinkle twinkle little star"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+POST /1197 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 27
+Content-Type: application/x-www-form-urlencoded
+
+twinkle twinkle little starGET /11970001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+<stdout>
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Content-Type: text/plain
+Location: ./11970001
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 15
+Connection: close
+Content-Type: text/plain; charset=us-ascii
+
+bigger monster
+GET
+</stdout>
+
+</verify>
+</testcase>
diff --git a/tests/data/test970 b/tests/data/test970
index e6d138f49..c0a88a798 100644
--- a/tests/data/test970
+++ b/tests/data/test970
@@ -61,7 +61,7 @@ Accept: */*
</protocol>
<stdout nonewline="yes">
-{"url_effective":"http://%HOSTIP:%HTTPPORT/970","http_code":200,"response_code":200,"http_connect":0,"time_total":0.000013,"time_namelookup":0.000013,"time_connect":0.000013,"time_appconnect":0.000013,"time_pretransfer":0.000013,"time_starttransfer":0.000013,"size_header":4019,"size_request":4019,"size_download":445,"size_upload":0,"speed_download":13,"speed_upload":13,"content_type":"text/html","num_connects":1,"time_redirect":0.000013,"num_redirects":0,"ssl_verify_result":0,"proxy_ssl_verify_result":0,"filename_effective":"log/out970","remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"local_ip":"127.0.0.1","local_port":13,"http_version":"1.1","scheme":"HTTP","curl_version":"curl-unit-test-fake-version"}
+{"url_effective":"http://%HOSTIP:%HTTPPORT/970","method":"GET","http_code":200,"response_code":200,"http_connect":0,"time_total":0.000013,"time_namelookup":0.000013,"time_connect":0.000013,"time_appconnect":0.000013,"time_pretransfer":0.000013,"time_starttransfer":0.000013,"size_header":4019,"size_request":4019,"size_download":445,"size_upload":0,"speed_download":13,"speed_upload":13,"content_type":"text/html","num_connects":1,"time_redirect":0.000013,"num_redirects":0,"ssl_verify_result":0,"proxy_ssl_verify_result":0,"filename_effective":"log/out970","remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"local_ip":"127.0.0.1","local_port":13,"http_version":"1.1","scheme":"HTTP","curl_version":"curl-unit-test-fake-version"}
</stdout>
</verify>
</testcase>