in reply to LWP::UserAgent non-feature?
I could be wrong, but my impression after having attempted to research this, is that the LWP::UserAgent->request method is being rather entirely unhelpful and unfriendly here
It looks like LWP::UserAgent is not the one splitting up the URL. It is *your* code that is doing that.
I'm guessing that you are under the impression that this is required of you for some reason. And yet, one of the very first lines of the documentation for one of the modules you use is:
$request = HTTP::Request->new(GET => 'http://www.example.com/');
So, clearly, the module expects to get a full URL. Were you assuming that the module is too stupid to do any processing on that URL and would just send "GET http://www.example.com/ HTTP/1.1"?
Perhaps you got this impression from looking at what as_string() returns? But the documentation says:
$r->as_string $r->as_string( $eol )Method returning a textual representation of the request.
It doesn't say "returns the string that will be sent to the HTTP server".
If you really need to see the code that constructs the actual HTTP request, then read the request() method in LWP::Protocol::http.
Change your code to stop doing naive splitting of the URL and use the modules as documented and you will probably get better results.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: LWP::UserAgent non-feature? (docs)
by rfg (Initiate) on Jan 13, 2015 at 19:11 UTC | |
by Anonymous Monk on Jan 13, 2015 at 23:39 UTC |