Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

domm (4030)

domm
  (email not shown publicly)
http://domm.plix.at/

Just in case you like to know, I'm currently full-time father of 2 kids, half-time Perl hacker, sort-of DJ, bicyclist, no longer dreadlocked and 33 years old

I'm also head of Vienna.pm [pm.org], maintainer of the CPANTS [perl.org] project, member of the TPF Grants Commitee [perlfoundation.org] and the YAPC Europe Foundation [yapceurope.org].

I've got stuff on CPAN [cpan.org], held various talks [domm.plix.at] and organised YAPC::Europe 2007 in Vienna [yapceurope.org].

Journal of domm (4030)

Thursday April 06, 2006
03:35 AM

LWP and HTTP/1.1

[ #29239 ]

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');

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.