in reply to Re: LWP HTTPS POST returns 500 EOF
in thread LWP HTTPS POST returns 500 EOF

Hi,
thanks for your quick response. Unfortunately, it did not solve my problem.
1. I first tried to add a GET request (see code below), but it did not help. I do not think cookies is the problem, it was just a desperate attempt from my side. I have tried to clear all cookies in IE (were no from swipnet) and set prompt for cookies but it did not try to set any cookies.
So I guess the cookie track can be closed.
2. I tried earlier to add the value for the submit button and tried it once more, but it does not seem to be the problem. When using IE I can change the value of the "Fortsätt" button to anything and it still works.

Modified code:
use HTTP::Request::Common qw(POST GET); use LWP::UserAgent; use LWP::Debug '+'; my $ua = LWP::UserAgent->new(); $ua->cookie_jar({}); $ua->agent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)'); my $req1 = GET 'https://login1.swipnet.se/login.php'; print $ua->request($req1)->as_string; push @{$ua->requests_redirectable }, 'POST'; my $req2 = POST 'https://login1.swipnet.se/login.php', [username => 'xxxxx', password => 'yyyyy', submit => 'Forts']; print $ua->request($req2)->as_string;

Any other suggestions ?
Best regards
/Johan

Replies are listed 'Best First'.
Re: Re: Re: LWP HTTPS POST returns 500 EOF
by fizbin (Chaplain) on Feb 26, 2004 at 13:16 UTC
    Well, I've looked at your other posts and the only thing I can suggest at this point is to try to match what internet explorer sends absolutely as closely as possible.

    Unfortunately, you're a little limited by LWP in what you can change about your request - it isn't possible to remove the TE header, nor can you easily force LWP to use HTTP/1.0. (I know, your IE isn't doing that, but IE has been known to use HTTP/1.0 when doing SSL through proxy connections)

    One thing you can do is add an "Accept" header with a value of "*/*" to your requests, though if that were really a problem I'd expect your GET to be failing as well.

    I suppose as one final shot, you could try sending in the request with the login information as a "GET" request. Yes, that's completely different from how IE sends it, but you've tried to be nice and identical, and that's gotten you nowhere.

    I've got a small https server here on my local network, and I'm going to see what IE and LWP send differently when presented a form like the one you gave in the top post.

      Ok, I think I await the results from your test towards your local https server to see what you come up with. I think the problem is lurking around inside the header, perhaps the referer or similar field. My problem is that I am unable to debug that information. Please post more information once you are finished with your tests.
      Best regards
      /Johan