Hello folks,
I am trying to troubleshoot both ends of an asp.net web "service". The provider of the service doesn't know much about what is going on. I suspect they are using something out-of-a-box. Thus, I'm left to figure out both ends myself.
The sequence of events goes like this:
1) I send a http get request with parameters to server
2) server does some processing
3) server returns a http response of raw text(no html formatting)
This works fine when I use a web browser such as IE or Firefox. However, when I send the request via LWP, I get a web service error back.
Assuming the problem is on my end, I suspect that I am sending some improper or invalid HTTP headers. To check this I sent a basic LWP request to a java servlet running on my own machine, and it shows that I sent it the following http header name-value pairs:
te: deflate,gzip;q=0.3
connection: TE, close
host: x.x.x.x
user-agent: libwww-perl/5.803
The first 2 headers appear messed up and it seems like my servlet may have had a parsing problem. My questions to the monks:
-how can I print out the entire raw LWP http request(first line, headers, and body), without having to send it elsewhere to print it?
-does LWP::UserAgent always add certain headers to be sent? How does one delete or clear out ALL headers? I have tried both
$response = $ua->get($url);and
$req = new HTTP::Request("GET",$url,HTTP::Headers->new);$response = $ua->request($req);conventions. Both produce the same http headers/request. Lastly, my PERL code worked fine when I tested it out on a few commercial websites such as google or yahoo.