From 3620e569b312476f1e63b298106f942079b5afe8 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Thu, 7 Sep 2017 19:11:02 +0100 Subject: form API: add new test 650. Now that the form API is deprecated and not used anymore in curl tool, a lot of its features left untested. Test 650 attempts to check all these features not tested elsewhere. --- tests/data/Makefile.inc | 2 +- tests/data/test650 | 122 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 tests/data/test650 (limited to 'tests/data') diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index d7ea5c951..d34e1351b 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -78,7 +78,7 @@ test608 test609 test610 test611 test612 test613 test614 test615 test616 \ test617 test618 test619 test620 test621 test622 test623 test624 test625 \ test626 test627 test628 test629 test630 test631 test632 test633 test634 \ test635 test636 test637 test638 test639 test640 test641 test642 \ -test643 test644 test645 test646 test647 test648 test649 \ +test643 test644 test645 test646 test647 test648 test649 test650 \ \ test700 test701 test702 test703 test704 test705 test706 test707 test708 \ test709 test710 test711 test712 test713 test714 test715 \ diff --git a/tests/data/test650 b/tests/data/test650 new file mode 100644 index 000000000..f429eac2f --- /dev/null +++ b/tests/data/test650 @@ -0,0 +1,122 @@ + + + +HTTP +HTTP POST +FORM + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Connection: close +Content-Type: text/html + +hello + + + +# Client-side + + +http + +# tool is what to use instead of 'curl' + +lib650 + + + +HTTP formpost using form API + + + Some data from stdin + + +http://%HOSTIP:%HTTPPORT/650 log/test650.filedata + + +This is data from a file. + + + +# +# Verify data after the test has been "shot" + + +s/^--------------------------[a-z0-9]*/------------------------------/ +s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/ + +# Note that the stripping above removes 12 bytes from every occurrence of the +# boundary string and since 5 of them are in the body contents, we see +# (5*12) == 60 bytes less + +POST /650 HTTP/1.1 +Host: 127.0.0.1:8990 +Accept: */* +Transfer-Encoding: chunked +Content-Type: multipart/form-data; boundary=---------------------------- +Expect: 100-continue + +5f0 +------------------------------ +Content-Disposition: form-data; name="fieldname" + +this is what we post to the silly web server +------------------------------ +Content-Disposition: form-data; name="fieldnam" + +uhis is what we post to the silly web serve +------------------------------ +Content-Disposition: form-data; name="multifile" +Content-Type: multipart/mixed; boundary=---------------------------- + +------------------------------ +Content-Disposition: attachment; filename="test650.filedata" +Content-Type: application/octet-stream + +This is data from a file. + +------------------------------ +Content-Disposition: attachment; filename="test650.filedata" +Content-Type: text/whatever + +This is data from a file. + +------------------------------ +Content-Disposition: attachment; filename="test650.filedata" +Content-Type: text/whatever + +This is data from a file. + +-------------------------------- + +------------------------------ +Content-Disposition: form-data; name="filecontents" +X-customheader-1: Header 1 data +X-customheader-2: Header 2 data + +This is data from a file. + +------------------------------ +Content-Disposition: form-data; name="formlength" + +1341 +------------------------------ +Content-Disposition: form-data; name="standardinput" +Content-Type: application/octet-stream + + Some data from stdin + +-------------------------------- + +0 + + + + -- cgit v1.2.3