it does not work
Sure it does. You've just forgotten to use the relevant modules. If we add those three important lines to the start of your code it does indeed run fine to completion.
use JSON; use Encode; use LWP::UserAgent; # Original content follows, unedited my @data = (); my $json_data = encode_utf8(encode_json(\@data)); my $ua = LWP::UserAgent->new; my $request = HTTP::Request->new(POST => $url2); $request->header("__atts" => $ajax_atts); $request->header('__ath' => $ajax_ath); $request->header('__atcrv' => $ajax_atcrv); #$request->content($json_data); my $response = $ua->request($request);
"It doesn't work" is as useful to a developer as "I'm ill" is to a medic. Try to be specific. SSCCE is best.
In reply to Re: LWP: transfer from Python to Perl
by hippo
in thread LWP: transfer from Python to Perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |