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 | HTTP/1.1 200 OK
|
| 31 | Date: Tue, 09 Nov 2010 14:49:00 GMT
|
| 32 | Server: test-server/fake swsclose
|
| 33 | Connection: close
|
| 34 | Content-Type: text/html
|
| 35 |
|
| 36 | hello |
| 37 | </datacheck> |
| 38 | </reply> |
| 39 | |
| 40 | # Client-side |
| 41 | <client> |
| 42 | <features> |
| 43 | Mime |
| 44 | </features> |
| 45 | <server> |
| 46 | http |
| 47 | </server> |
| 48 | # tool is what to use instead of 'curl' |
| 49 | <tool> |
| 50 | lib%TESTNUMBER |
| 51 | </tool> |
| 52 | |
| 53 | <name> |
| 54 | HTTP duplicate easy handle with mime data |
| 55 | </name> |
| 56 | <command> |
| 57 | http://%HOSTIP:%HTTPPORT/%TESTNUMBER |
| 58 | </command> |
| 59 | <file name="log/file%TESTNUMBER.txt"> |
| 60 | This is data from a file |
| 61 | </file> |
| 62 | </client> |
| 63 | |
| 64 | # |
| 65 | # Verify data after the test has been "shot" |
| 66 | <verify> |
| 67 | <strippart> |
| 68 | s/^--------------------------[a-z0-9]*/------------------------------/ |
| 69 | s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/ |
| 70 | </strippart> |
| 71 | # Note that the stripping above removes 12 bytes from every occurrence of the |
| 72 | # boundary string and since 5 of them are in the body contents, we see |
| 73 | # (5*12) == 60 bytes less |
| 74 | <protocol> |
| 75 | POST /%TESTNUMBER HTTP/1.1
|
| 76 | Host: %HOSTIP:%HTTPPORT
|
| 77 | Accept: */*
|
| 78 | Content-Length: 0
|
| 79 |
|
| 80 | POST /%TESTNUMBER HTTP/1.1
|
| 81 | Host: %HOSTIP:%HTTPPORT
|
| 82 | Accept: */*
|
| 83 | Transfer-Encoding: chunked
|
| 84 | Content-Type: multipart/form-data; boundary=----------------------------
|
| 85 | Expect: 100-continue
|
| 86 |
|
| 87 | %if hyper |
| 88 | 1AF
|
| 89 | %else |
| 90 | 1af
|
| 91 | %endif |
| 92 | ------------------------------
|
| 93 | Content-Disposition: form-data; name="greeting"
|
| 94 | Content-Type: application/X-Greeting
|
| 95 | Content-Transfer-Encoding: base64
|
| 96 | X-Test-Number: %TESTNUMBER
|
| 97 |
|
| 98 | aGVsbG8=
|
| 99 | ------------------------------
|
| 100 | Content-Disposition: form-data; filename="file%TESTNUMBER.txt"
|
| 101 | Content-Type: text/plain
|
| 102 |
|
| 103 | This is data from a file |
| 104 |
|
| 105 | ------------------------------
|
| 106 | Content-Disposition: form-data
|
| 107 |
|
| 108 |
|
| 109 | 1
|
| 110 | d
|
| 111 | 1
|
| 112 | u
|
| 113 | 1
|
| 114 | m
|
| 115 | 1
|
| 116 | m
|
| 117 | 1
|
| 118 | y
|
| 119 | 1
|
| 120 | |
| 121 |
|
| 122 | 30
|
| 123 |
|
| 124 | --------------------------------
|
| 125 |
|
| 126 | 0
|
| 127 |
|
| 128 | </protocol> |
| 129 | </verify> |
| 130 | </testcase> |