kbarker has asked for the wisdom of the Perl Monks concerning the following question:
Looking for an example on performing a post with LWP. The page I am working on has two fields (user/password) and then a submit button. The submit but does not have a name - it is a name-less element. Code Below. Note $USER and $PASS come from the required file listed in line 1.
Sorry for the messed up post - I cleaned it up. No errors are thrown - just hangs. The DATA tags for the username/passowrd are the same. I am not responsible for the existing HTML - just trying to access the site.
require 'c:\ken2\config.pl'; use strict; use warnings; use LWP::UserAgent; my $url = "https://LINKGOESHERE/"; my $port = 443; my $lwp = LWP::UserAgent->new( ); my $response = $lwp->post($url, DATA=>our $USER, DATA=>our $PASS, VALU +E=>"Submit"); if($response->is_success){ print $response->content; } else{ print $response->status_line, "\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: performing a POST on HTTPS using LWP module
by Herkum (Parson) on Jun 03, 2010 at 14:21 UTC | |
by kbarker (Initiate) on Jun 03, 2010 at 18:24 UTC | |
Re: performing a POST on HTTPS using LWP module
by marto (Cardinal) on Jun 03, 2010 at 14:11 UTC | |
Re: performing a POST on HTTPS using LWP module
by almut (Canon) on Jun 03, 2010 at 14:33 UTC | |
by kbarker (Initiate) on Jun 03, 2010 at 15:29 UTC | |
by almut (Canon) on Jun 03, 2010 at 15:38 UTC |