in reply to File upload with LWP::UserAgent
my $request = HTTP::Request->new(POST 'http://example.com', Content_Ty +pe => 'multipart/form-data', Content => [file_0 => ['options2.txt']]) +;
You're missing => after POST. Which probably explains the immediate error: POST 'http://..' is seen as a function call (from HTTP:::Request::Common) instead of a string.
AFAIK the content should be added using the content method, not as an argument to the constructor (since constructor arguments are all parsed as headers. See HTTP::Request
Anyway, using WWW::Mechanize will probably be easier and make your code a bit more robust.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File upload with LWP::UserAgent
by PerlRob (Sexton) on Jun 13, 2008 at 02:11 UTC | |
by PerlRob (Sexton) on Jun 13, 2008 at 03:30 UTC |