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

Hi hippo,

Sorry for these basic questions. Thats one of my first web programs. I logged the packet:. I see some differences, but I can not really charge if this can be the rootcause: (first good one, second problem one)
Accept-Encoding: identity Content-Type: application/x-www-form-urlencoded Content-Length: 2 User-Agent: Python-urllib/3.6 __Atts: 2018 __Ath: FnD= __Atcrv: 88 Connection: close TE: deflate,gzip;q=0.3 Connection: TE, close User-Agent: libwww-perl/6.26 __atcrv: 88 __ath: FnD= __atts: 2018 Content-Length: 2

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

    This confirms what I suspected in my previous post - namely that you have not set the Content-Type header. Most web servers will depend on this to be set correctly in the requests they receive.

      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

        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.