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

Reply via email to