develooper Front page | perl.libwww | Postings from February 2001

What am I doing wrong?

Erik Wheeler
February 5, 2001 12:05
What am I doing wrong?
Message ID:
Hello all:

I'm having a problem creating a GET request to a CGI script (on 
eBay). For some reason, the header key/value pairs don't seem to be 

When I print $req->as_string,  I get:

--- HTTP::Request=HASH(0x22dd0f0) ---
User-Agent: libwww-perl/5.13


...and the script gets a response which is the same if you just go 
directly to the base URL.

I'm assuming that there's something wrong with my syntax somewhere, 
but I've checked the pods and the LWP FAQ many times with no luck. 
What am I doing wrong?

Here's my script:

#!/usr/bin/perl -w

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

my ($ua,$req,$res,$url);

$ua = new LWP::UserAgent;

$url = '';

$req = GET $url,
		  MfcISAPICommand =>	'GetResult',
		  ht		=>	1,
  		  ebaytag1	=>	'ebayreg',
		  query		=>	'Spofford',
  		  query2	=>	'Spofford',
		  search_option  =>	1,
  	 	  srchdesc	=>	'y',
		  exclude	=>	'',
		  category0	=>	'',
		  minPrice	=>	'',
		  maxPrice	=>	'',
  		  ebaytag1code =>	0,
		  st		=>	0,
		  SortProperty =>	'MetaNewSort',

$res = $ua->request($req);

print $req->as_string;

print $res->is_success ? $res->content : $res->status_line;

Thanks for any help you can give.

Erik Wheeler Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About