xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | POST |
| 6 | POST callback |
| 7 | </keywords> |
| 8 | </info> |
| 9 | # |
| 10 | # Server-side |
| 11 | <reply> |
| 12 | <data> |
| 13 | HTTP/1.1 200 OK
|
| 14 | Date: Tue, 09 Nov 2010 14:49:00 GMT
|
| 15 | Server: test-server/fake swsclose
|
| 16 | Connection: close
|
| 17 | Content-Type: text/html
|
| 18 |
|
| 19 | hello |
| 20 | </data> |
| 21 | </reply> |
| 22 | |
| 23 | # Client-side |
| 24 | <client> |
| 25 | <server> |
| 26 | http |
| 27 | </server> |
| 28 | # tool is what to use instead of 'curl' |
| 29 | <tool> |
| 30 | lib%TESTNUMBER |
| 31 | </tool> |
| 32 | |
| 33 | <name> |
| 34 | send HTTP POST using read callback |
| 35 | </name> |
| 36 | <command> |
| 37 | http://%HOSTIP:%HTTPPORT/%TESTNUMBER |
| 38 | </command> |
| 39 | </client> |
| 40 | |
| 41 | # |
| 42 | # Verify data after the test has been "shot" |
| 43 | <verify> |
| 44 | <strippart> |
| 45 | # remove CR that CURLOPT_TRANSFERTEXT added, when CharConv enabled: |
| 46 | s/^(this is what we post to the silly web server)\r\n/$1\n/ if($has_charconv) |
| 47 | </strippart> |
| 48 | <protocol> |
| 49 | POST /%TESTNUMBER HTTP/1.1
|
| 50 | Host: %HOSTIP:%HTTPPORT
|
| 51 | Accept: */*
|
| 52 | Content-Length: 45
|
| 53 | Content-Type: application/x-www-form-urlencoded
|
| 54 |
|
| 55 | this is what we post to the silly web server |
| 56 | </protocol> |
| 57 | </verify> |
| 58 | </testcase> |