xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP POST |
| 6 | HTTP MIME POST |
| 7 | </keywords> |
| 8 | </info> |
| 9 | |
| 10 | # |
| 11 | # Server-side |
| 12 | <reply> |
| 13 | <data> |
| 14 | HTTP/1.1 200 OK
|
| 15 | Date: Tue, 09 Nov 2010 14:49:00 GMT
|
| 16 | Server: test-server/fake swsclose
|
| 17 | Connection: close
|
| 18 | Content-Type: text/html
|
| 19 |
|
| 20 | hello |
| 21 | </data> |
| 22 | <datacheck> |
| 23 | HTTP/1.1 200 OK
|
| 24 | Date: Tue, 09 Nov 2010 14:49:00 GMT
|
| 25 | Server: test-server/fake swsclose
|
| 26 | Connection: close
|
| 27 | Content-Type: text/html
|
| 28 |
|
| 29 | hello |
| 30 | </datacheck> |
| 31 | </reply> |
| 32 | |
| 33 | # Client-side |
| 34 | <client> |
| 35 | <features> |
| 36 | Mime |
| 37 | </features> |
| 38 | <server> |
| 39 | http |
| 40 | </server> |
| 41 | # tool is what to use instead of 'curl' |
| 42 | <tool> |
| 43 | lib%TESTNUMBER |
| 44 | </tool> |
| 45 | |
| 46 | <name> |
| 47 | HTTP mimepost early end of data detection |
| 48 | </name> |
| 49 | <command> |
| 50 | http://%HOSTIP:%HTTPPORT/%TESTNUMBER |
| 51 | </command> |
| 52 | <file name="log/file%TESTNUMBER.txt"> |
| 53 | This is data from a file |
| 54 | </file> |
| 55 | </client> |
| 56 | |
| 57 | # |
| 58 | # Verify data after the test has been "shot" |
| 59 | <verify> |
| 60 | <strippart> |
| 61 | s/^--------------------------[a-z0-9]*/------------------------------/ |
| 62 | s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/ |
| 63 | </strippart> |
| 64 | # Note that the stripping above removes 12 bytes from every occurrence of the |
| 65 | # boundary string and since 5 of them are in the body contents, we see |
| 66 | # (5*12) == 60 bytes less |
| 67 | <protocol> |
| 68 | POST /%TESTNUMBER HTTP/1.1
|
| 69 | Host: %HOSTIP:%HTTPPORT
|
| 70 | Accept: */*
|
| 71 | Transfer-Encoding: chunked
|
| 72 | Content-Type: multipart/form-data; boundary=----------------------------
|
| 73 | Expect: 100-continue
|
| 74 |
|
| 75 | %if hyper |
| 76 | C1
|
| 77 | %else |
| 78 | c1
|
| 79 | %endif |
| 80 | ------------------------------
|
| 81 | Content-Disposition: form-data; name="field1"
|
| 82 |
|
| 83 | dummy
|
| 84 | ------------------------------
|
| 85 | Content-Disposition: form-data; name="field2"
|
| 86 |
|
| 87 |
|
| 88 | 5
|
| 89 | dummy
|
| 90 | 91
|
| 91 |
|
| 92 | ------------------------------
|
| 93 | Content-Disposition: form-data; name="field3"; filename="file%TESTNUMBER.txt"
|
| 94 | Content-Type: text/plain
|
| 95 |
|
| 96 |
|
| 97 | 49
|
| 98 | This is data from a file |
| 99 |
|
| 100 | --------------------------------
|
| 101 |
|
| 102 | 0
|
| 103 |
|
| 104 | </protocol> |
| 105 | </verify> |
| 106 | </testcase> |