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

Thanks hippo

I added $request->content_type('application/x-www-form-urlencoded'); and some other minor things, but still error 500. The only difference (what I can see now) is now:

User-Agent: Python-urllib/3.6 Connection: close TE: deflate,gzip;q=0.3 Connection: close,TE User-Agent: libwww-perl/6.26
Can this be the reason? How can I influence TE and Connection ? I added

${${$request}{'_headers'}}{'Connection'}='close';</p><p>
but than Connection changed from :

Connection: TE,close to Connection: close,TE

Replies are listed 'Best First'.
Re^6: LWP: transfer from Python to Perl
by hippo (Archbishop) on Jan 11, 2018 at 09:29 UTC

    Those should both be irrelevant from the server's point of view in terms of the successful processing of the request. See the RFC section for detail about the specific headers if interested.

    If you are happy with the request as it stands then I suggest you contact whoever runs the server, send them the dump of your request, the response, your client IP address and the timestamp and ask them why it isn't succeeding.

      Thanks a lot hippo for your patience and your help !!!!!!!!!

      I just could solve my issue now!

      It seems that the server checked some information which was sent with the previous get. In python the get and the following post were done with the same agent. In perl I used LWP::Simple for the get and LWP::UserAgent; for the POST. This I was changing now and now it works. (Or I changed something which I am not aware by doing this change. The GET sent before the POST is now for sure different, in the response I see no difference between the two versions)

      But without your help I would not have manged (at least not in this short time) to get the POST done fully in the needed way.

      Thanks a lot !!