during DESTROY. (Vany Serezhkin)
- Fixed parsing of multipart bodies with boundaries that contain commas.
(Tomas Doran, http://rt.cpan.org/Public/Bug/Display.html?id=41407)
+ - Dropped YAML, we now use Perl as a serialization format in our tests. We call this PAML ;)
1.05 2008-12-01 17:15:00
- Removed useless eval + require in new().
+++ /dev/null
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: HTTP-Body
-version: 0.9
-version_from: lib/HTTP/Body.pm
-installdirs: site
-requires:
- Carp: 0
- File::Temp: 0.14
- IO::File: 0
- YAML: 0.39
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
HTTP::Headers => 0,
IO::File => 0,
Test::Deep => 0,
- YAML => '0.39'
}
);
use strict;
use warnings;
use lib "$FindBin::Bin/../lib";
+use lib "$FindBin::Bin/../t/lib";
use Benchmark qw[cmpthese timethese];
use CGI qw[];
use HTTP::Body qw[];
use IO::Handle qw[];
use IO::File qw[O_RDONLY SEEK_SET];
-use YAML qw[LoadFile];
+use PAML qw[LoadFile];
my ( $headers, $content, $message );
foreach my $benchmark ( @benchmarks ) {
- $headers = LoadFile("$FindBin::Bin/../$benchmark-headers.yml");
+ $headers = LoadFile("$FindBin::Bin/../$benchmark-headers.pml");
$content = IO::File->new( "$FindBin::Bin/../$benchmark-content.dat", O_RDONLY )
or die $!;
use strict;
use warnings;
use lib "$FindBin::Bin/../lib";
+use lib "$FindBin::Bin/../t/lib";
use Benchmark qw[timethese];
use HTTP::Body qw[];
use IO::File qw[O_RDONLY];
-use YAML qw[LoadFile Dump];
+use PAML qw[LoadFile];
-my $headers = LoadFile("t/data/multipart/003-headers.yml");
+my $headers = LoadFile("t/data/multipart/003-headers.pml");
my $run = sub {
my $bsize = shift;
use strict;
use warnings;
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
use Test::More tests => 140;
use Test::Deep;
use HTTP::Body;
use File::Spec::Functions;
use IO::File;
-use YAML;
+use PAML;
use File::Temp qw/ tempdir /;
my $path = catdir( getcwd(), 't', 'data', 'multipart' );
for ( my $i = 1; $i <= 13; $i++ ) {
my $test = sprintf( "%.3d", $i );
- my $headers = YAML::LoadFile( catfile( $path, "$test-headers.yml" ) );
- my $results = YAML::LoadFile( catfile( $path, "$test-results.yml" ) );
+ my $headers = PAML::LoadFile( catfile( $path, "$test-headers.pml" ) );
+ my $results = PAML::LoadFile( catfile( $path, "$test-results.pml" ) );
my $content = IO::File->new( catfile( $path, "$test-content.dat" ) );
my $body = HTTP::Body->new( $headers->{'Content-Type'}, $headers->{'Content-Length'} );
my $tempdir = tempdir( 'XXXXXXX', CLEANUP => 1, DIR => File::Spec->tmpdir() );
use strict;
use warnings;
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
use Test::More tests => 31;
use Cwd;
use HTTP::Body;
use File::Spec::Functions;
use IO::File;
-use YAML;
+use PAML;
my $path = catdir( getcwd(), 't', 'data', 'urlencoded' );
for ( my $i = 1; $i <= 6; $i++ ) {
my $test = sprintf( "%.3d", $i );
- my $headers = YAML::LoadFile( catfile( $path, "$test-headers.yml" ) );
- my $results = YAML::LoadFile( catfile( $path, "$test-results.yml" ) );
+ my $headers = PAML::LoadFile( catfile( $path, "$test-headers.pml" ) );
+ my $results = PAML::LoadFile( catfile( $path, "$test-results.pml" ) );
my $content = IO::File->new( catfile( $path, "$test-content.dat" ) );
my $body = HTTP::Body->new( $headers->{'Content-Type'}, $headers->{'Content-Length'} );
use strict;
use warnings;
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
use Test::More tests => 12;
use Cwd;
use HTTP::Body;
use File::Spec::Functions;
use IO::File;
-use YAML;
+use PAML;
my $path = catdir( getcwd(), 't', 'data', 'octetstream' );
for ( my $i = 1 ; $i <= 3 ; $i++ ) {
my $test = sprintf( "%.3d", $i );
- my $headers = YAML::LoadFile( catfile( $path, "$test-headers.yml" ) );
+ my $headers = PAML::LoadFile( catfile( $path, "$test-headers.pml" ) );
my $results =
slurp_fh( IO::File->new( catfile( $path, "$test-results.dat" ) ) );
my $content = IO::File->new( catfile( $path, "$test-content.dat" ) );
use strict;
use warnings;
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
use Test::More tests => 12;
use Cwd;
use HTTP::Body;
use File::Spec::Functions;
use IO::File;
-use YAML;
+use PAML;
my $path = catdir( getcwd(), 't', 'data', 'xforms' );
for ( my $i = 1; $i <= 2; $i++ ) {
my $test = sprintf( "%.3d", $i );
- my $headers = YAML::LoadFile( catfile( $path, "$test-headers.yml" ) );
- my $results = YAML::LoadFile( catfile( $path, "$test-results.yml" ) );
+ my $headers = PAML::LoadFile( catfile( $path, "$test-headers.pml" ) );
+ my $results = PAML::LoadFile( catfile( $path, "$test-results.pml" ) );
my $content = IO::File->new( catfile( $path, "$test-content.dat" ) );
my $body = HTTP::Body->new( $headers->{'Content-Type'}, $headers->{'Content-Length'} );
--- /dev/null
+{
+ "Benchmark" => "Message containing 4 parts, 2 with filename",
+ "Content-Length" => 4010288,
+ "Content-Type" => "multipart/form-data; boundary=xYzZY"
+}
+++ /dev/null
----
-Content-Length: 4010288
-Content-Type: multipart/form-data; boundary=xYzZY
-Benchmark: Message containing 4 parts, 2 with filename
--- /dev/null
+{
+ "Benchmark" => "Message containing 27 parts, none with filename",
+ "Content-Length" => 8088,
+ "Content-Type" => "multipart/form-data; boundary=xYzZY"
+}
+++ /dev/null
----
-Content-Length: 8088
-Content-Type: multipart/form-data; boundary=xYzZY
-Benchmark: Message containing 27 parts, none with filename
--- /dev/null
+{
+ "Benchmark" => "Message containing 27 kv pairs",
+ "Content-Length" => 6622,
+ "Content-Type" => "application/x-www-form-urlencoded"
+}
+++ /dev/null
----
-Content-Length: 6622
-Content-Type: application/x-www-form-urlencoded
-Benchmark: Message containing 27 kv pairs
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+ "Content-Length" => 1817,
+ "Content-Type" => "multipart/form-data; boundary=----------0xKhTmLbOuNdArY"
+}
+++ /dev/null
----
-Content-Length: 1817
-Content-Type: multipart/form-data; boundary=----------0xKhTmLbOuNdArY
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload2",
+ "size" => 78
+ },
+ "upload4" => {
+ "headers" => {
+ "Content-Disposition" => "form-data; name=\"upload4\"; filename=\"0\""
+ },
+ "filename" => 0,
+ "name" => "upload4",
+ "size" => 0
+ },
+ "upload3" => {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload3\"; filename=\"blank.pl\""
+ },
+ "filename" => "blank.pl",
+ "name" => "upload3",
+ "size" => 0
+ },
+ "upload" => [
+ {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 78
+ },
+ {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 78
+ }
+ ]
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- Content-Type: application/octet-stream
- name: upload
- size: 78
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- Content-Type: application/octet-stream
- name: upload
- size: 78
- upload2:
- filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="hello.pl"
- Content-Type: application/octet-stream
- name: upload2
- size: 78
- upload3:
- filename: blank.pl
- headers:
- Content-Disposition: form-data; name="upload3"; filename="blank.pl"
- Content-Type: application/octet-stream
- name: upload3
- size: 0
- upload4:
- filename: 0
- headers:
- Content-Disposition: form-data; name="upload4"; filename="0"
- name: upload4
- size: 0
--- /dev/null
+{
+ "User-Agent" => "Lynx/2.8.5rel.2 libwww-FM/2.14",
+ "Content-Length" => 1585,
+ "Content-Type" => "multipart/form-data; boundary=LYNX"
+}
+++ /dev/null
----
-Content-Length: 1585
-Content-Type: multipart/form-data; boundary=LYNX
-User-Agent: Lynx/2.8.5rel.2 libwww-FM/2.14
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"/Users/chansen/hello.pl\""
+ },
+ "filename" => "/Users/chansen/hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => [
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"/Users/chansen/hello.pl\""
+ },
+ "filename" => "/Users/chansen/hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"/Users/chansen/hello.pl\""
+ },
+ "filename" => "/Users/chansen/hello.pl",
+ "name" => "upload",
+ "size" => 71
+ }
+ ]
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.\r\n",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.\r\n"
-upload:
- upload:
- - filename: /Users/chansen/hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="/Users/chansen/hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- - filename: /Users/chansen/hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="/Users/chansen/hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- upload2:
- filename: /Users/chansen/hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="/Users/chansen/hello.pl"
- Content-Type: text/plain
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "ELinks/0.9.2 (textmode; Darwin 7.9.0 Power Macintosh; 167x36)",
+ "Content-Length" => 1507,
+ "Content-Type" => "multipart/form-data; boundary=00000000000000000000000000000000"
+}
+++ /dev/null
----
-Content-Length: 1507
-Content-Type: multipart/form-data; boundary=00000000000000000000000000000000
-User-Agent: ELinks/0.9.2 (textmode; Darwin 7.9.0 Power Macintosh; 167x36)
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => [
+ {
+ "headers" => {
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ {
+ "headers" => {
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 71
+ }
+ ]
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\n\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\n\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- name: upload
- size: 71
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- name: upload
- size: 71
- upload2:
- filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="hello.pl"
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)",
+ "Content-Length" => 1987,
+ "Content-Type" => "multipart/form-data; boundary=---------------------------168071508944249"
+}
+++ /dev/null
----
-Content-Length: 1987
-Content-Type: multipart/form-data; boundary=---------------------------168071508944249
-User-Agent: Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => [
+ {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 71
+ }
+ ]
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- Content-Type: application/octet-stream
- name: upload
- size: 71
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- Content-Type: application/octet-stream
- name: upload
- size: 71
- upload2:
- filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="hello.pl"
- Content-Type: application/octet-stream
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4",
+ "Content-Length" => 1817,
+ "Content-Type" => "multipart/form-data; boundary=---------------------------168072824752491622650073"
+}
+++ /dev/null
----
-Content-Length: 1817
-Content-Type: multipart/form-data; boundary=---------------------------168072824752491622650073
-User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => [
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 71
+ }
+ ]
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- upload2:
- filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="hello.pl"
- Content-Type: text/plain
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)",
+ "Content-Length" => 1740,
+ "Content-Type" => "multipart/form-data; boundary=---------------------------7d53c2922c"
+}
+++ /dev/null
----
-Content-Length: 1740
-Content-Type: multipart/form-data; boundary=---------------------------7d53c2922c
-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+ },
+ "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => [
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+ },
+ "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+ },
+ "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+ "name" => "upload",
+ "size" => 71
+ }
+ ]
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- - filename: C:\WINDOWS\Skrivbord\hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="C:\WINDOWS\Skrivbord\hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- - filename: C:\WINDOWS\Skrivbord\hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="C:\WINDOWS\Skrivbord\hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- upload2:
- filename: C:\WINDOWS\Skrivbord\hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="C:\WINDOWS\Skrivbord\hello.pl"
- Content-Type: text/plain
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Mac_PowerPC Mac OS X; en) Opera 8.01",
+ "Content-Length" => 1629,
+ "Content-Type" => "multipart/form-data; boundary=----------Bv684bhJBhreYbdRAUxHhF"
+}
+++ /dev/null
----
-Content-Length: 1629
-Content-Type: multipart/form-data; boundary=----------Bv684bhJBhreYbdRAUxHhF
-User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Mac_PowerPC Mac OS X; en) Opera 8.01
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => [
+ {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ {
+ "headers" => {
+ "Content-Type" => "application/octet-stream",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+ },
+ "filename" => "hello.pl",
+ "name" => "upload",
+ "size" => 71
+ }
+ ]
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- Content-Type: application/octet-stream
- name: upload
- size: 71
- - filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="hello.pl"
- Content-Type: application/octet-stream
- name: upload
- size: 71
- upload2:
- filename: hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="hello.pl"
- Content-Type: application/octet-stream
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)",
+ "Content-Length" => 1750,
+ "Content-Type" => "multipart/form-data; boundary=---------------------------7d52bc247fc"
+}
+++ /dev/null
----
-Content-Length: 1750
-Content-Type: multipart/form-data; boundary=---------------------------7d52bc247fc
-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+ },
+ "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => [
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+ },
+ "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+ },
+ "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+ "name" => "upload",
+ "size" => 71
+ }
+ ]
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- - filename: C:\WINDOWS\Skrivbord\hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="C:\WINDOWS\Skrivbord\hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- - filename: C:\WINDOWS\Skrivbord\hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="C:\WINDOWS\Skrivbord\hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- upload2:
- filename: C:\WINDOWS\Skrivbord\hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="C:\WINDOWS\Skrivbord\hello.pl"
- Content-Type: text/plain
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)",
+ "Content-Length" => 1851,
+ "Content-Type" => "multipart/form-data; boundary=---------------------------7d53941f40118"
+}
+++ /dev/null
----
-Content-Length: 1851
-Content-Type: multipart/form-data; boundary=---------------------------7d53941f40118
-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => [
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload",
+ "size" => 71
+ }
+ ]
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- - filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- - filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- upload2:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)",
+ "Content-Length" => 1831,
+ "Content-Type" => "multipart/form-data; boundary=---------------------------7d561c5012e"
+}
+++ /dev/null
----
-Content-Length: 1831
-Content-Type: multipart/form-data; boundary=---------------------------7d561c5012e
-User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ "upload1" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload1\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload1",
+ "size" => 71
+ }
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- upload1:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload1"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload1
- size: 71
- upload2:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)",
+ "Content-Length" => 1851,
+ "Content-Type" => "multipart/form-data; boundary=---------------------------7d534d1d60150"
+}
+++ /dev/null
----
-Content-Length: 1851
-Content-Type: multipart/form-data; boundary=---------------------------7d534d1d60150
-User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ "upload1" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload1\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload1",
+ "size" => 71
+ }
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- upload1:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload1"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload1
- size: 71
- upload2:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)",
+ "Content-Type" => "multipart/form-data; boundary=---------------------------7d534d1d60150",
+ "Transfer-Encoding" => "chunked"
+}
+++ /dev/null
----
-Transfer-Encoding: chunked
-Content-Type: multipart/form-data; boundary=---------------------------7d534d1d60150
-User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {
+ "upload2" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload2",
+ "size" => 71
+ },
+ "upload" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload",
+ "size" => 71
+ },
+ "upload1" => {
+ "headers" => {
+ "Content-Type" => "text/plain",
+ "Content-Disposition" => "form-data; name=\"upload1\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+ },
+ "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+ "name" => "upload1",
+ "size" => 71
+ }
+ },
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
- upload:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload
- size: 71
- upload1:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload1"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload1
- size: 71
- upload2:
- filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
- headers:
- Content-Disposition: form-data; name="upload2"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
- Content-Type: text/plain
- name: upload2
- size: 71
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+ "Content-Length" => 900,
+ "Content-Type" => "multipart/form-data; boundary=----------0x'K()h+T_m,L-b.O/u:N=d?ArY"
+}
+++ /dev/null
----
-Content-Length: 900
-Content-Type: multipart/form-data; boundary=----------0x'K()h+T_m,L-b.O/u:N=d?ArY
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
--- /dev/null
+{
+ "body" => undef,
+ "param" => {
+ "text2" => "",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: ""
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+ "Content-Length" => 4,
+ "Content-Type" => "application/octet-stream"
+}
+++ /dev/null
----
-Content-Length: 4
-Content-Type: application/octet-stream
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+ "Content-Length" => 1025,
+ "Content-Type" => "application/x.atom+xml"
+}
+++ /dev/null
----
-Content-Length: 1025
-Content-Type: application/x.atom+xml
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+ "Content-Type" => "application/x.atom+xml",
+ "Transfer-Encoding" => "chunked"
+}
+++ /dev/null
----
-Transfer-Encoding: chunked
-Content-Type: application/x.atom+xml
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+ "Content-Length" => 499,
+ "Content-Type" => "application/x-www-form-urlencoded"
+}
+++ /dev/null
----
-Content-Length: 499
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {},
+ "param" => {
+ "text2" => "\303\245\303\244\303\266\303\245\303\244\303\266",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "encoding" => "foo=bar",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: åäöåäö
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
- encoding: foo=bar
-upload: {}
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
+ "Content-Length" => 15,
+ "Content-Type" => "application/x-www-form-urlencoded"
+}
+++ /dev/null
----
-Content-Length: 15
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {},
+ "param" => {
+ "one" => "foo",
+ "two" => "bar"
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- one: foo
- two: bar
-upload: {}
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+ "Content-Type" => "application/x-www-form-urlencoded",
+ "Transfer-Encoding" => "chunked"
+}
+++ /dev/null
----
-Transfer-Encoding: chunked
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {},
+ "param" => {
+ "text2" => "\303\245\303\244\303\266\303\245\303\244\303\266",
+ "text1" => "Ratione accusamus aspernatur aliquam",
+ "encoding" => "foo=bar",
+ "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+ "select" => [
+ "A",
+ "B"
+ ]
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- select:
- - A
- - B
- text1: Ratione accusamus aspernatur aliquam
- text2: åäöåäö
- textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
- encoding: foo=bar
-upload: {}
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
+ "Content-Length" => 16,
+ "Content-Type" => "application/x-www-form-urlencoded"
+}
+++ /dev/null
----
-Content-Length: 16
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {},
+ "param" => {
+ "one" => "foo",
+ "two" => "bar"
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- one: foo
- two: bar
-upload: {}
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
+ "Content-Length" => 15,
+ "Content-Type" => "application/x-www-form-urlencoded"
+}
+++ /dev/null
----
-Content-Length: 15
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {},
+ "param" => {
+ "one" => "foo",
+ "two" => "bar"
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- one: foo
- two: bar
-upload: {}
--- /dev/null
+{
+ "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
+ "Content-Length" => 19,
+ "Content-Type" => "application/x-www-form-urlencoded"
+}
+++ /dev/null
----
-Content-Length: 19
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
--- /dev/null
+{
+ "body" => undef,
+ "upload" => {},
+ "param" => {
+ "one" => "foo",
+ "two" => "bar=bam"
+ }
+}
+++ /dev/null
----
-body: ~
-param:
- one: foo
- two: bar=bam
-upload: {}
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+ "Content-Length" => 313,
+ "Content-Type" => "multipart/related; boundary=----------0xKhTmLbOuNdArY; start=<asdfg\@asdfg.com>"
+}
+++ /dev/null
----
-Content-Length: 313
-Content-Type: multipart/related; boundary=----------0xKhTmLbOuNdArY; start=<asdfg@asdfg.com>
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
--- /dev/null
+{
+ "body" => "<model><data1>asdfg</data1><data2>asdfg</data2></model>",
+ "upload" => {
+ "zxcvb\@zxcvb.com" => {
+ "headers" => {
+ "Content-ID" => "<zxcvb\@zxcvb.com>"
+ },
+ "filename" => "zxcvb\@zxcvb.com",
+ "name" => "zxcvb\@zxcvb.com",
+ "size" => 17
+ },
+ "qwert\@qwerty.com" => {
+ "headers" => {
+ "Content-ID" => "<qwert\@qwerty.com>"
+ },
+ "filename" => "qwert\@qwerty.com",
+ "name" => "qwert\@qwerty.com",
+ "size" => 17
+ }
+ },
+ "param" => {
+ "XForms:Model" => "<model><data1>asdfg</data1><data2>asdfg</data2></model>"
+ },
+ "start" => "asdfg\@asdfg.com"
+}
+++ /dev/null
----
-body: <model><data1>asdfg</data1><data2>asdfg</data2></model>
-start: asdfg@asdfg.com
-param:
- XForms:Model: <model><data1>asdfg</data1><data2>asdfg</data2></model>
-upload:
- qwert@qwerty.com:
- filename: qwert@qwerty.com
- headers:
- Content-ID: <qwert@qwerty.com>
- name: qwert@qwerty.com
- size: 17
- zxcvb@zxcvb.com:
- filename: zxcvb@zxcvb.com
- headers:
- Content-ID: <zxcvb@zxcvb.com>
- name: zxcvb@zxcvb.com
- size: 17
--- /dev/null
+{
+ "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+ "Content-Length" => 55,
+ "Content-Type" => "application/xml"
+}
+++ /dev/null
----
-Content-Length: 55
-Content-Type: application/xml
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
--- /dev/null
+{
+ "body" => "<model><data1>asdfg</data1><data2>asdfg</data2></model>",
+ "upload" => {},
+ "param" => {
+ "XForms:Model" => "<model><data1>asdfg</data1><data2>asdfg</data2></model>"
+ }
+}
+++ /dev/null
----
-body: <model><data1>asdfg</data1><data2>asdfg</data2></model>
-param:
- XForms:Model: <model><data1>asdfg</data1><data2>asdfg</data2></model>
-upload: {}
--- /dev/null
+package PAML;
+use strict;
+use warnings;
+
+# "PAML Ain't Markup Language"!!!
+
+use Carp qw[croak];
+use Data::Dumper qw[];
+use IO::File qw[];
+
+BEGIN {
+ our @EXPORT_OK = qw(
+ DumpFile
+ LoadFile
+ );
+
+ require Exporter;
+ *import = \&Exporter::import;
+}
+
+sub DumpFile ($$) {
+ my ($path, $struct) = @_;
+
+ my $data = do {
+ local $Data::Dumper::Indent = 1;
+ local $Data::Dumper::Purity = 1;
+ local $Data::Dumper::Terse = 1;
+ local $Data::Dumper::Useqq = 1;
+ Data::Dumper->Dump([$struct], ['PAML']);
+ };
+
+ my $io = IO::File->new($path, '>')
+ || croak(qq[Couldn't open path '$path' in write mode: $!]);
+
+ $io->binmode
+ || croak(qq[Couldn't binmode filehandle: $!]);
+
+ $io->print($data)
+ || croak(qq[Couldn't write filehandle: $!]);
+
+ $io->close
+ || croak(qq[Couldn't close filehandle: $!]);
+
+ 1;
+}
+
+sub LoadFile ($) {
+ my ($path) = @_;
+
+ my $data = do {
+
+ my $io = IO::File->new($path, '<')
+ || corak(qq[Couldn't open path '$path' in read mode: $!]);
+
+ $io->binmode
+ || croak(qq[Couldn't binmode filehandle: $!]);
+
+ my $exp = -s $path;
+ my $buf = do { local $/; <$io> };
+ my $got = length $buf;
+
+ $io->close
+ || croak(qq[Couldn't close filehandle: $!]);
+
+ ($exp == $got)
+ || croak(qq[I/O read mismatch, expexted: $exp got: $got]);
+
+ $buf;
+ };
+
+ if (substr($data, 0, 1) eq '{') {
+ substr($data, 0, 0, '+');
+ }
+
+ my $struct = eval($data);
+
+ (!$@)
+ || croak(qq[LoadFile couldn't eval data: $@]);
+
+ $struct;
+}
+
+1;
+