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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.