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

What am I doing wrong?

From:
Erik Wheeler
Date:
February 5, 2001 12:05
Subject:
What am I doing wrong?
Message ID:
p04330102b6a3c1f7bc9c@[24.48.160.218]
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 
appended.

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

--- HTTP::Request=HASH(0x22dd0f0) ---
GET http://search-desc.ebay.com/search/search.dll
Host: search-desc.ebay.com
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 = 'http://search-desc.ebay.com/search/search.dll';

$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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About