<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br>Hi Mongers,<br><br>I am not getting the proper response from the below URL when used with LWP request. However curl gives proper response. Do I need to add any thing extra in the code.  The same perl code works perfectly with other URLs.<br>
<br><a href="http://cgjobjarservice-axzz2sbpnu.elasticbeanstalk.com/service/getLookupData/category">http://cgjobjarservice-axzz2sbpnu.elasticbeanstalk.com/service/getLookupData/category</a><br><br><br>[perl@localhost ~]$  <b>curl -i  <a href="http://cgjobjarservice-axzz2sbpnu.elasticbeanstalk.com/service/getLookupData/category">http://cgjobjarservice-axzz2sbpnu.elasticbeanstalk.com/service/getLookupData/category</a></b><br>
<b>HTTP/1.1 200 OK</b><br>Content-Type: application/json;charset=UTF-8<br>Date: Sat, 22 Feb 2014 09:12:43 GMT<br>Server: Apache-Coyote/1.1<br>transfer-encoding: chunked<br>Connection: keep-alive<br><br>[{"category_id":0,"category_name":"Development","category_description":"Software Development"},{"category_id":1,"category_name":"Pursuit","category_description":"Pursuit"},{"category_id":2,"category_name":"Information Gathering","category_description":"Information Gathering"},{"category_id":3,"category_name":"Documentation","category_description":"Documentation"}]<br>
<br>[perl@localhost ~]$ <b>./mytest/Tool-link/<a href="http://get.pl">get.pl</a> </b><br>Request URL    :<a href="http://cgjobjarservice-axzz2sbpnu.elasticbeanstalk.com/service/getLookupData/category">http://cgjobjarservice-axzz2sbpnu.elasticbeanstalk.com/service/getLookupData/category</a><br>
Request Method    :GET<br><b>Response Status    :400</b><br>Response Content    :<html><head><title>Apache Tomcat/7.0.42 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.42</h3></body></html><br>
<br>[perl@localhost ~]$ cat ./mytest/Tool-link/<a href="http://get.pl">get.pl</a> <br>#!/usr/bin/env perl<br><br>use LWP::UserAgent;<br>use HTTP::Request;<br>use Data::Dumper;<br><br>my $method = 'GET';<br>my $uri =<br>
'<a href="http://cgjobjarservice-axzz2sbpnu.elasticbeanstalk.com/service/getLookupData/category">http://cgjobjarservice-axzz2sbpnu.elasticbeanstalk.com/service/getLookupData/category</a>';<br>#$uri = '<a href="http://www.thomas-bayer.com/sqlrest/PRODUCT/49">http://www.thomas-bayer.com/sqlrest/PRODUCT/49</a>';<br>
my $ua = LWP::UserAgent->new;<br><br>my $request = HTTP::Request->new( $method, $uri );<br>my $response = $ua->request($request);<br><br>print "Request URL\t:",    $response->request->url,    "\n";<br>
print "Request Method\t:", $response->request->method, "\n";<br>print "Response Status\t:",  $response->code,    "\n";<br>print "Response Content\t:", $response->content, "\n";<br>
<br>#print Dumper($response);<br>[perl@localhost ~]$ <br><br></div></div>