Click here to get back home

troubles with HTTP::Request::Common

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
troubles with HTTP::Request::Common Some Guy 03-08-2005
Posted by Some Guy on March 8, 2005, 11:42 pm
Please log in for more thread options


I'm trying to use HTTP::Request::Common, and can't get it to work.
Specifically, I'm trying to use it on
http://www.geocaching.com/seek/nearest.aspx?zip=asdf&dist=100 to get
geocaches by zipcode, using the following:

------------------------------------------

use strict;
use warnings;

use LWP::UserAgent;
use HTTP::Request::Common;


my $action = POST
'http://www.geocaching.com/seek/nearest.aspx?zip=asdf&dist=100',
[
        'DropDownTaxonomy' => '9a79e6ce-3344-409c-bbe9-496530baf758',
'LocationPanel1:ddSearchType' => 'ZIP',
'LocationPanel1:OriginText' => '90210'
];

$action->header( 'User-Agent' => 'Mozilla/5.0' );

my $ua = LWP::UserAgent->new;
my $request = $ua->request( $action );

$request->is_success or die $request->status_line;

my $content = $request->content;


my $file = "tmp.txt";
open(FILE, ">$file") or die "Error opening file";
print FILE $content;
close(FILE);

------------------------------------------

I seem to only be getting the
http://www.geocaching.com/seek/nearest.aspx?zip=asdf&dist=100 page
returned to me, not the search results page. Any ideas?


Similar ThreadsPosted
HTTP::Request::Common::POST and UTF-8 September 27, 2005, 12:21 pm
http request headers October 1, 2004, 12:47 pm
Help regarding HTTP::Request:POST February 24, 2006, 11:31 pm
How can I make HTTP::Request handle gzipped content? September 3, 2004, 2:11 am
Parse tcpdump for HTTP Request Response Headers July 29, 2007, 2:10 pm
XML::LibXML::Common does not install Common.pm November 27, 2007, 11:21 pm
Net::Analysis Parse tcpdump for HTTP Request/Response Headers July 29, 2007, 6:41 am
HTTP::Request::Form - Problem pressing input type=image button February 1, 2005, 7:56 am
Net::Telnet Juniper display XML troubles June 5, 2007, 5:52 am
ANNOUNCE: Regexp::Common::time December 8, 2005, 6:20 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap