1 2 3 4 5 6 7 8 9 10 11 12
my $request = HTTP::Request->new('POST'=> $url, Content_Type => 'form-data; boundary=----schnippschnapp', CONTENT => [username => $login->{USERNAME}, password => $login->{PASSWORD}, ]); my $request = HTTP::Request->new($type, $url, $header, $content); my $response = $ua->request($request); unless ($response->is_success()) { print Dumper $response; }
1
2
3
'_msg' => 'Not a SCALAR reference',
'_rc' => 500,
'_content' => 'Not a SCALAR reference at C:/Perl_5_30_2_1_64bit/perl/vendor/lib/LWP/Protocol/http.pm line 260.'
QuoteThe optional $content argument should be a string of bytes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use HTTP::Request::Common;
my $login = {
USERNAME => 'asdf',
PASSWORD => 'ääää',
};
my $r = HTTP::Request::Common::POST(
'http://127.0.0.1:12555',
Content_Type => 'multipart/form-data; boundary=----schnippschnapp',
Content => [
username => $login->{USERNAME},
password => $login->{PASSWORD},
]
);
2021-03-14T18:12:52 GwenDragonQuoteThe optional $content argument should be a string of bytes.
2021-03-14T18:12:52 GwenDragon