Perlbal::XS::HTTPHeaders(3) Perlbal extension for processing HTTP headers.

SYNOPSIS


use HTTPHeaders;
my $hdr = Perlbal::XS::HTTPHeaders->new("GET / HTTP/1.0\r\nConnection: keep-alive\r\n\r\n");
if ($hdr->getMethod == M_GET()) {
print "GET: ", $hdr->getURI(), "\n";
print "Connection: ", $hdr->getHeader('Connection'), "\n";
}

DESCRIPTION

This module is used to read HTTP headers from a string and to parse them into an internal storage format for easy access and modification. You can also ask the module to reconstitute the headers into one big string, useful if you're writing a proxy and need to read and write headers while maintaining the ability to modify individual parts of the whole.

The goal is to be fast. This is a lot faster than doing all of the text processing in Perl directly, and a lot of the flexibility of Perl is maintained by implementing the library in Perl and descending from Perlbal::HTTPHeaders.

Exportable constants

  H_REQUEST
  H_RESPONSE
  M_GET
  M_POST
  M_HEAD
  M_OPTIONS
  M_PUT
  M_DELETE

KNOWN BUGS

There are no known bugs at this time. Please report any you find!

AUTHOR

Mark Smith, <[email protected]>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Danga Interactive, Inc.

Copyright (C) 2005 by Six Apart, Ltd.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.