[ic] [SPAM] Re: LWP::UserAgent

Frank Reitzenstein frank at aussievitamin.com
Thu Mar 10 18:00:53 UTC 2011


Gert van der Spoel wrote:
>> Hello,
>>
>> I created my own usertag like your ups shipping tags for use in AU.
>>
>> This section retrieves the shipping charge from Australia Post based on
>> weights and postcodes:
>>
>> my $return;
>> my $error="OK";
>> my $content;
>> my
>>     
> $url="http://drc.edeliver.com.au/rateCalc.asp?Height=$height&Length=$length&
> Weight=$weight&Width=$width&Pickup_Postcode=$origin&Destination_Postcode=$zi
> p&Country=$country&Service_Type=$modex&Quantity=1";
>   
>> use LWP::UserAgent;
>> my $ua = LWP::UserAgent->new;
>> $ua->timeout(5);
>> $ua->env_proxy;
>> my $aus_post=0;
>> my $response =$ua->get("$url");
>>
>> if ($response->is_success)
>> {
>> $content = $response->content;
>> }
>> else
>> {
>> $aus_post=1;
>> }
>>
>>
>> $content used to return Australia post's web page which looks like this:
>>
>>
>>     
> http://drc.edeliver.com.au/rateCalc.asp?Height=420&Length=210&Weight=100&Wid
> th=460&Pickup_Postcode=6076&Destination_Postcode=298128&Country=KE&Service_T
> ype=AIR&Quantity=1
>   
>> But now it returns "".
>>
>> What could blocking my code form the internet?
>>     
> Does it not return an error? Tried checking: $response->status_line to see
> what value it has?
>
> CU,
>
> Gert
>
>
>
>   
Gert,

Thankyou for your quick response. I have dumped the status, content and
url to a file:

STATUS 200 OK
CONTENT
URL
http://drc.edeliver.com.au/rateCalc.asp?Height=100&Length=100&Weight=1000&Width=100&Pickup_Postcode=6076&Destination_Postcode=01543&Country=US&Service_Type=SEA&Quantity=1

Everything looks ok, but no content. This happened when I upgraded from
IC 5.2 to 5.6 last week. It worked for 4 years.

LWP::Simple produces the same result.

Regards,

Frank








More information about the interchange-users mailing list