in reply to Re: PUT a Multipart request in PERL
in thread PUT a Multipart request in PERL
Hi Monk, Here is my code:
use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $xmlfile = [ 'C:\\temp\\Test_1.xml', 'Test_1.xml', 'Content-type' => 'text/xml' ]; my $docfile = [ 'C:\\temp\\Test_1.doc', 'Test_1.doc', 'Content-type' => 'application/msword' ]; my $signedurl = 'http://someURL.com'; my $myresponse = $mech->put($signedurl, 'Content' => [ 'file1' => +$xmlfile, 'file2' => $docfile ] );
It is producing following ERROR:
Not a SCALAR reference at C:/Dwimperl/perl/vendor/lib/HTTP/Message.pm +line 156. at C:/Dwimperl/perl/vendor/lib/HTTP/Message.pm line 156 HTTP::Message::add_content('HTTP::Request=HASH(0x32e2d9c)', 'ARRAY(0x3 +2113f4)') called at C:/Dwimperl/perl/vendor/lib/HTTP/Request/Common.p +m line 108 HTTP::Request::Common::_simple_req(undef, undef) called at C:/Dwimperl +/perl/vendor/lib/HTTP/Request/Common.pm line 22 HTTP::Request::Common::PUT('http://someURL.com.../', 'Content', 'ARRAY +(0x32113f4)') called at C:/Dwimperl/perl/site/lib/WWW/Mechanize.pm line 439 WWW::Mechanize::_SUPER_put('WWW::Mechanize=HASH(0x30a72bc)', 'http://someURL.com/...', 'Content', 'ARRAY(0x32113f4)') called at C:/Dwimperl/perl/site/lib/WWW/Mechanize.pm line 430 WWW::Mechanize::put('WWW::Mechanize=HASH(0x30a72bc)', 'http://someURL. +com/...', 'Content', 'ARRAY(0x32113f4)') called at multipart_1.pm line 110 Utils::Words_multipart('Utils=HASH(0x30a49b4)') called at multipart_1. +pm line 138 Press any key to continue . . .
Please guide
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: PUT a Multipart request in PERL
by Anonymous Monk on Apr 06, 2015 at 23:49 UTC | |
by xpert (Initiate) on Apr 07, 2015 at 04:44 UTC | |
by Anonymous Monk on Apr 07, 2015 at 07:28 UTC |
In Section
Seekers of Perl Wisdom