gjwilson21 has asked for the wisdom of the Perl Monks concerning the following question:

When i create a request with the following line:
$req=POST 'https://www.abc.com/fileUpload.aspx', Content_Type=>'multip +art/form_data', Content => [__VIEWSTATE=>'dDwtMjRrKEnBI=', aa=>'I', file1=>['ABCD.DAT']] $req->as_string;
and print the request, Iam not getting the content of the file. Instead the output is something like
POST https://www.abcd.com/fileUpload.aspx Content-Length: 411 Content-Type: multipart/form_data VIEWSTATE=dDwtMjRrKEnBI%3D&aa=I&file1=ABCD.DAT

Replies are listed 'Best First'.
Re: Problem with HTTP::Request
by Corion (Patriarch) on Jul 24, 2007 at 06:04 UTC
      Since the server is throwing an error with the content, i printed the content and the content didn't contain any file. Thats why.
        Try this
        echo >test.txt perl - use HTTP::Request::Common; $a = POST qw[http://test/ Content_type form-data], content => [ qw,a b c d,, file =>['test.txt']]; die $a->as_string __END__