in reply to Re: Trying to get HTTP/1.1 at end of request
in thread Trying to get HTTP/1.1 at end of request
Thanks -- I did know about the protocol method, but couldn't understand how I could use it before the message went out. Your code does output the correct thing from the debugger, but now I'm getting an error from HTTP::Message that it's having trouble cloning the headers (line 27).
The investigation continues. Thanks!
Update: OK -- going through HTTP::Request means you have to reorganize the parameters from a hashref to a refarray to a flattened hash:
so that the code in HTTP::Headers$refhash = { UserId => 533, Something => 'foobart' } $refarray = [ map { $_, $refhash->{$_} } keys %$refhash ];
accepts the data. Now I'm back to getting a 500 Internal Server error from the server I'm hitting .. I'll check back tomorrow when I can talk to the SysAdmin in Europe.sub header { my $self = shift; Carp::croak('Usage: $h->header($field, ...)') unless @_; my(@old); my %seen; while (@_) { my $field = shift; my $op = @_ ? ($seen{lc($field)}++ ? 'PUSH' : 'SET') : 'GET'; @old = $self->_header($field, shift, $op); } return @old if wantarray; return $old[0] if @old <= 1; join(", ", @old); }
|
|---|