2007-01-23 10:25:56 +08:00
|
|
|
<testcase>
|
2010-08-25 07:45:31 +08:00
|
|
|
<info>
|
|
|
|
<keywords>
|
|
|
|
HTTP
|
|
|
|
HTTP POST
|
|
|
|
</keywords>
|
|
|
|
</info>
|
|
|
|
|
2004-06-04 20:24:47 +08:00
|
|
|
# Server-side
|
|
|
|
<reply>
|
|
|
|
<data>
|
|
|
|
HTTP/1.1 200 OK swsclose
|
2020-02-28 22:00:03 +08:00
|
|
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
2004-06-04 20:24:47 +08:00
|
|
|
Server: test-server/fake
|
2006-11-25 21:32:04 +08:00
|
|
|
Content-Length: 11
|
2004-06-04 20:24:47 +08:00
|
|
|
|
|
|
|
blablabla
|
|
|
|
|
|
|
|
</data>
|
|
|
|
</reply>
|
|
|
|
|
|
|
|
# Client-side
|
|
|
|
<client>
|
|
|
|
<server>
|
|
|
|
http
|
|
|
|
</server>
|
|
|
|
<name>
|
|
|
|
HTTP RFC1867-formpost a file from stdin with "faked" filename
|
|
|
|
</name>
|
|
|
|
<command>
|
2021-03-13 00:38:26 +08:00
|
|
|
http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F field1=contents1 -F "fileupload=@-;filename=/dev/null;type=text/x-null;format=x-curl"
|
2004-06-04 20:24:47 +08:00
|
|
|
</command>
|
|
|
|
|
|
|
|
<stdin>
|
|
|
|
line1
|
|
|
|
line2
|
|
|
|
line3
|
|
|
|
line4
|
|
|
|
line5
|
|
|
|
line6
|
|
|
|
line7
|
|
|
|
line8
|
|
|
|
</stdin>
|
|
|
|
</client>
|
|
|
|
|
|
|
|
# Verify data after the test has been "shot"
|
|
|
|
<verify>
|
|
|
|
<strip>
|
2020-10-02 19:45:24 +08:00
|
|
|
^(Content-Type: multipart/form-data;|------------).*
|
2004-06-04 20:24:47 +08:00
|
|
|
</strip>
|
|
|
|
<protocol>
|
2021-03-13 00:38:26 +08:00
|
|
|
POST /we/want/%TESTNUMBER HTTP/1.1
|
2007-09-15 03:32:31 +08:00
|
|
|
Host: %HOSTIP:%HTTPPORT
|
2020-10-02 19:45:24 +08:00
|
|
|
User-Agent: curl/%VERSION
|
2004-06-04 20:24:47 +08:00
|
|
|
Accept: */*
|
2017-10-12 21:25:59 +08:00
|
|
|
Content-Length: 360
|
2004-06-04 20:24:47 +08:00
|
|
|
Content-Type: multipart/form-data; boundary=----------------------------5dbea401cd8c
|
|
|
|
|
|
|
|
------------------------------5dbea401cd8c
|
|
|
|
Content-Disposition: form-data; name="field1"
|
|
|
|
|
|
|
|
contents1
|
|
|
|
------------------------------5dbea401cd8c
|
|
|
|
Content-Disposition: form-data; name="fileupload"; filename="/dev/null"
|
2010-08-25 07:45:31 +08:00
|
|
|
Content-Type: text/x-null;format=x-curl
|
2004-06-04 20:24:47 +08:00
|
|
|
|
|
|
|
line1
|
|
|
|
line2
|
|
|
|
line3
|
|
|
|
line4
|
|
|
|
line5
|
|
|
|
line6
|
|
|
|
line7
|
|
|
|
line8
|
|
|
|
|
|
|
|
------------------------------5dbea401cd8c--
|
|
|
|
</protocol>
|
|
|
|
</verify>
|
2007-01-23 10:25:56 +08:00
|
|
|
</testcase>
|