/ domm

I hack Perl for fun and
profit.

Follow me on twitter!
Atom Icom ... on Atom!
<<<<<<<<<<
12.06.2006: This weekend: suspend2, ipw2200 and DaVinci
11.06.2006: Austrian Perl Workshop 2006 roundup
06.06.2006: Hacktivity, party and Austrian Perl Workshop
01.06.2006: Talks!
22.05.2006: Perl Hacks
17.05.2006: New CPANTS site!
10.05.2006: Austrian Perl Workshop 2006
22.04.2006: mutt header_cache and a general nice day
08.04.2006: Istanbul
06.04.2006: LWP and HTTP/1.1

So, to conform to some anal webservice I had to issue a HTTP-request with 'HTTP/1.1' in the 'headers' (actually in the first line posted to the server, like 'POST /foo/bar HTTP/1.1').

First I wondered that HTTP::Request isn't issuing it by default (or at least 'HTTP/1.0'). But the requests only started with 'POST /foo/bar'. After some futile paging through LWP docs, I greped the source code, and after some fiddling discovered the protocol method in HTTP::Message.

Now, HTTP::Request ISA HTTP::Message, and states so in the docs: "HTTP::Request is a subclass of HTTP::Message and therefore inherits its methods.". I still missed this point, which caused a 30-minutes detour. And I can only blame me, Grr

But now I know, and for future (google) reference:

my $req=HTTP::Request->new(...);

$req->protocol('HTTP/1.1');

Original: http://use.perl.org/~domm/journal/29239

Comments (via disqus)

>>>>>>>>>>