problems assembling POST HTTP::Request

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I'm trying to post a filename (that generally comes out of a html
<input type="file" box) to a perl script out of my perl script that
should pretend as if it was done by hand on the webpage...
The code POST request i came up with looks like this:

                my $post = HTTP::Request->new(POST => $PostPage,
                Content_Type => 'form-data',
                Content      => [ filename  => 'file://mnt/ENGINEERING/Docs/Tropos/

but when i execute it i get:

Bad header argument at ./ line 50

Where line 50 is the first line of my POST request... I do'nt
understand, what kind of header argument may I require?

Thanks for hints and ideas!

Re: problems assembling POST HTTP::Request

Quoted text here. Click to load it

HTTP::Request->new takes up to four arguments, the third of which must
be an HTTP::Headers object. You have passed six, none of which are.

I suspect you want the POST function (not method) out of
HTTP::Request::Common, or the ->post method on LWP::UserAgent.


Site Timeline