Re: Confused on how to use LWP with https
Robert Nicholson (steffi@best.com)
03 Oct 1998 18:27:25 -0700
Robert Nicholson <steffi@shell8.ba.best.com> writes:
> Can anybody offer any reason why the following simple request doesn't work?
>
> #! /usr/bin/perl
>
> # Create a user agent object
> use LWP::UserAgent;
> $ua = new LWP::UserAgent;
> $ua->agent("AgentName/0.1 " . $ua->agent);
>
> # Create a request
> my $req = new HTTP::Request POST => 'https://webxpress331.fidelity.com/ftgw/webxpress/Login';
>
> $req->content_type('application/x-www-form-urlencoded');
> $req->content('SSN=XXXX&PIN=XXXX');
>
> # Pass request to the user agent and get a response back
> my $res = $ua->request($req);
> print $res->content;
>
> # Check the outcome of the response
> if ($res->is_success) {
> print $res->content;
> } else {
> print "Bad luck this time\n";
> }
>
> The idea is that I want to eventually access fidelity's real time quotes
> but I must first get SSL working. Before I can access their quotes I need
> to create a session so I believe the above gives me everything I need to
> submit my next request.
>
>
> ..
>
> I get back..
>
> [root@justine Crypt-SSLeay-0.06]# ./test2.pl
>
> <html> <head>
> <title>Login redirection</title>
> </head>
>
> <body bgcolor="#FFFFFF" text="#000000" link="#000080" vlink="#000080" alink="#0000FF">
>
> <font face=arial,helvetica size=2>
> Processing..
> <P>
> Please wait.
> </font>
> </body> </html>
>
> Bad luck this time