in reply to Re^2: LWP: transfer from Python to Perl
in thread LWP: transfer from Python to Perl

For the header key I saw also when I Dumper($request) the '_' were changed to '-'. (use Data::Dumper qw(Dumper); ) So I tried to write the header directly in the request structure.
${${$request}{'_headers'}}{'__atts'}=$ajax_atts; ${${$request}{'_headers'}}{'__ath'}=$ajax_ath; ${${$request}{'_headers'}}{'__atcrv'}=$ajax_atcrv2; print Dumper($request)
Now the '_' are unchanged, but still error 500.

Replies are listed 'Best First'.
Re^4: LWP: transfer from Python to Perl
by poj (Abbot) on Jan 11, 2018 at 09:49 UTC

    You can preserve the underscores with a colon

    $request->header( ':__Atts' => $ajax_atts, ':__Ath' => $ajax_ath, ':__Atcrv'=> $ajax_atcrv);

    see NON-CANONICALIZED FIELD NAMES in HTTP::Headers

    poj