Perlbal::XS::HTTPHeaders(3pm)

Perlbal::XS::HTTPHeaders3pm

Perlbal extension for processing http headers.

Usage

  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";
  }

Overview

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!

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

Author

Mark Smith, <[email protected]>

From libperlbal-xs-httpheaders-perl 0.20-3+b4 in Debian 13 (Trixie). Parsed by carta from the page's man source.