CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Can't seem to do a POST request.


New User

Oct 18, 2012, 12:09 AM

Post #1 of 2 (3382 views)
Can't seem to do a POST request. Can't Post


my $userAgent=new LWP::UserAgent; 
my $otherResponse = $userAgent->post("", ["bb_isbns" => $bookData{'searchNumber'},]);

My script crashes at the second line.
The hash value has been checked for definedness.
I have no access to the error log.

What is wrong?


Oct 20, 2012, 7:58 PM

Post #2 of 2 (3374 views)
Re: [ferulebezel] Can't seem to do a POST request. [In reply to] Can't Post

use strict;
use warnings;

use WWW::Mechanize;

my $mech = WWW::Mechanize->new();

$mech->agent_alias('Windows Mozilla');


#this selects the search box

price_group => 'buy',
key_val => $bookData{'searchNumber'},
#submit the form data

#get the page content
my $content = mech->content();

i like useing WWW::Mechanize which makes things easier to do.. this is untested... When looking at the page source their was some jave script call backs for the fourm that on submit it checked something but dont know what. So youll have to tinker with this..

(This post was edited by wickedxter on Oct 20, 2012, 7:58 PM)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives