----- Original Message ----- From: "Dermot" <paik...@googlemail.com>
To: "Perl List" <beginners@perl.org> Sent: Wednesday, February 10, 2010 10:14 AM Subject: Re: LWP error returned
On 10 February 2010 15:47, Mike Blezien <mick...@frontiernet.net> wrote:
Hello, I've run into an error while using the LWP module which I haven't come accross before and was wondering what is means. This is the coding I'm using: ---------------------------------------------------------------------------------------------------------- use LWP::UserAgent; my $USERNAME = "XXXXXX"; my $PASSWORD = "XXXXXX"; my $URL = "http://technet.rapaport.com/HTTP/RapLink/download.aspx?Polish=I,EX,VG,G,F,P&Symm=I,EX,VG,G,F,P&SortBy=owner&White=1&Fancy=1&Programmatically=yes"; my $URL = qq~https://technet.rapaport.com/HTTP/RapLink/download.aspx?Shape=B&CaratSizeFrom=0.4&CaratSizeTo=3.5&ColorFrom=D&ColorTo=J&ClarityFrom=FL&ClarityTo=SI1&CutFrom=I&CutTo=G&GradeReport=GIA,AGS&Polish=I,EX,VG,G&Symmetry=I,EX,VG,G&FluorescenceIntensity=N,VSL,F,M,S&SellerLogin=67155,60745,32235,39321,43460,28426,43412,67000,68708,50841&SortBy=owner&White=1&Programmatically=yes~; my $ua = LWP::UserAgent->new(); $ua->timeout(60); #create request my $req = new HTTP::Request 'POST' => $URL; $req->content_type("application/x-www-form-urlencoded"); #add creadentials to request $req->authorization_basic($USERNAME,$PASSWORD); my $res = $ua->request($req); my $content = $res->content(); ------------------------------------------------------------------- The error/content is returns is "Length Required" .... not exactly sure what that means.
A pure guess would be that the host requires a 'content-length' header OR the web service requires a length parameter.
Is there something else I need to add to the coding the to pass this parameter ??
Thx's Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/