Re: query reg PDF
"David Moreno" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Mar 12, 2008 at 5:17 PM, prats <[email protected]> wrote: > Hi, > > I had another question. > Currently in my perl script I am invoking a servlet URL and passing few parameters to the servlet. As shown below: > > my $req = new HTTP::Request POST => "$hostName/CPIWS/servlet/cat.cis.psd.sis.authoring.periodicals.client.scheduler.SendPDFDetailsTask"; > $req->content_type('application/x-www-form-urlencoded'); > $req->content("appAccName=$appAccName&appAccPwd=$appAccPwd&userName=$username&ieCntrlNo=$ieControlNo&pdfPath=$pdfPath"); > > Now, I also need to pass a PDF document to my servlet. HTTP::Request::Common is your bitch: As from its pod: POST 'http://www.perl.org/survey.cgi', Content_Type => 'form-data', Content => [ name => 'Gisle Aas', email => '[email protected]', gender => 'M', born => '1964', init => ["$ENV{HOME}/.profile"], ] In reality, you just have to specify the first element on an array of one of the elements being passed to Content. -- David Moreno - http://www.damog.net/ Yes, you can.