Hi there Perlmonks,
I can't seem to figure out how to create a proper POST HTTP::Request in order to send files.
When I use:
$res = $ua->request(POST $server,
Content_Type => 'form-data',
Content => [ login => $ICT_login,
filenaamOriginal => $test_file,
test=>'JA',
filenaam => [$test_filename, $test_file],
]);
The files are transmitted to the webserver without any problems.
I need to send files using a different method for creating a HTTP::Request object because I need to use the
$req->proxy_authorization_basic method, which I can't access
using the previous method.
When I use the following code:
$req = HTTP::Request->new (POST => $server,
Content_Type => 'form-data',
Content => [login => $ICT_login,
filenaamOriginal => $test_file,
test => 'JA',
filenaam => [$test_filename,$test_file],
]);
I get the following error message: Bad header argument at eclient.pl line 2035
My guts say this a very trivial problem but I can't seem to figure out what I'm doing wrong ;-)
Thanks!
Felix
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.