brian123 has asked for the wisdom of the Perl Monks concerning the following question:
how do I pass the paramenter to the search? for example, if I manually do it, I might type in 055 023 010 and click the search button. I have read that the parameters are passed on the address field but for some reason I do not see it. How can I find out the exact line passed to the server for the search?#!/usr/bin/perl -w # Create a user agent object use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent("MyApp/0.1 "); # Create a request my $req = HTTP::Request->new(POST => 'http://www.sanmateocountytaxco +llector.org/SMCWPS/pages/secureSearch.jsp'); $req->content_type('application/x-www-form-urlencoded'); $req->content('query=libwww-perl&mode=dist'); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print $res->status_line, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What parameters should I send?
by moritz (Cardinal) on Dec 06, 2010 at 08:28 UTC | |
by brian123 (Novice) on Dec 06, 2010 at 23:23 UTC | |
by moritz (Cardinal) on Dec 07, 2010 at 07:13 UTC | |
by brian123 (Novice) on Dec 07, 2010 at 08:20 UTC | |
by moritz (Cardinal) on Dec 07, 2010 at 08:24 UTC | |
| |
by Corion (Patriarch) on Dec 07, 2010 at 08:24 UTC | |
|
Re: What parameters should I send?
by perl_lover (Chaplain) on Dec 06, 2010 at 09:23 UTC | |
|
Re: What parameters should I send?
by Anonymous Monk on Dec 06, 2010 at 22:22 UTC |