xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP POST |
| 6 | </keywords> |
| 7 | </info> |
| 8 | |
| 9 | # Server-side |
| 10 | <reply> |
| 11 | <data> |
| 12 | HTTP/1.1 200 OK swsclose |
| 13 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 14 | Server: test-server/fake |
| 15 | Content-Length: 10 |
| 16 | |
| 17 | blablabla |
| 18 | </data> |
| 19 | </reply> |
| 20 | |
| 21 | # Client-side |
| 22 | <client> |
| 23 | <features> |
| 24 | Mime |
| 25 | </features> |
| 26 | <server> |
| 27 | http |
| 28 | </server> |
| 29 | <name> |
| 30 | HTTP formpost a file with spaces in name |
| 31 | </name> |
| 32 | <command> |
| 33 | http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "name=@log/fie ld %TESTNUMBER" |
| 34 | </command> |
| 35 | # We create this file before the command is invoked! |
| 36 | <file name="log/fie ld %TESTNUMBER"> |
| 37 | data inside the file |
| 38 | </file> |
| 39 | </client> |
| 40 | |
| 41 | # Verify data after the test has been "shot" |
| 42 | <verify> |
| 43 | <strip> |
| 44 | ^(Content-Type: multipart/form-data;|------------).* |
| 45 | </strip> |
| 46 | <protocol> |
| 47 | POST /we/want/%TESTNUMBER HTTP/1.1
|
| 48 | Host: %HOSTIP:%HTTPPORT
|
| 49 | User-Agent: curl/%VERSION
|
| 50 | Accept: */*
|
| 51 | Content-Length: 223
|
| 52 | Content-Type: multipart/form-data; boundary=----------------------------b0b3d6d23991
|
| 53 |
|
| 54 | ------------------------------b0b3d6d23991
|
| 55 | Content-Disposition: form-data; name="name"; filename="fie ld %TESTNUMBER"
|
| 56 | Content-Type: application/octet-stream
|
| 57 |
|
| 58 | data inside the file |
| 59 |
|
| 60 | ------------------------------b0b3d6d23991--
|
| 61 | </protocol> |
| 62 | </verify> |
| 63 | </testcase> |