Subject: | rpc.bloglines.com does not accept _trivial_http_get()'s User-Agent |
See <http://www.perlmonks.org/?node_id=541973> for details.
Briefly, there are some servers out there that, for some reason, don't
like "lwp-trivial/VERSION" as the User-Agent. "lwp-simple/VERSION"
works, "LWP::Simple/VERSION" works, "LWP::Trivial/VERSION" works,
"lwp-trivial/VERSION" does NOT.
This matters because a simple enough get() calls _trivial_http_get()
which uses "lwp-trivial/VERSION" as the value for the User-Agent header.
The other get* calls (get_old(), getprint(), and getstore()) use
"LWP::UserAgent/VERSION" as their User-Agent, and the problem is
averted. All it takes is a simple change:
--- LWP-Simple.pm.orig 2006-04-07 17:40:43.000000000 -0400
+++ LWP-Simple.pm 2006-04-07 17:41:04.000000000 -0400
@@ -169,7 +169,7 @@
print $sock join("\015\012" =>
"GET $path HTTP/1.0",
"Host: $netloc",
- "User-Agent: lwp-trivial/$VERSION",
+ "User-Agent: LWP::Simple/$VERSION",
"", "");
my $buf = "";