Christian Hansen

NAME

Net::FastCGI::Header - Object representation of a FCGI_Header

SYNOPSIS

    # Constructors
    $header = Net::FastCGI::Header->new($type, $request_id);
    $header = Net::FastCGI::Header->new($type, $request_id, $content_length);
    $header = Net::FastCGI::Header->new($type, $request_id, $content_length, $padding_length);
    $header = Net::FastCGI::Header->parse($octets);
    
    # Methods
    $octets         = $header->build;
    $type           = $header->get_type;
    $request_id     = $header->get_request_id;
    $content_length = $header->get_content_length;
    $padding_length = $header->get_padding_length;
    $boolean        = $header->has_content;
    $boolean        = $header->has_padding;
    $string         = $header->to_string;

DESCRIPTION

CONSTRUCTORS

new

Constructs an instance of Net::FastCGI::Header.

Usage

    $header = Net::FastCGI::Header->new($type, $request_id);
    $header = Net::FastCGI::Header->new($type, $request_id, $content_length);
    $header = Net::FastCGI::Header->new($type, $request_id, $content_length, $padding_length);

Arguments

$type

An unsigned 8-bit integer.

$request_id

An unsigned 16-bit integer.

$content_length (optional)

An unsigned 16-bit integer. Defaults to 0.

$padding_length (optional)

An unsigned 8-bit integer. Defaults to compute_padding_length($content_length).

Returns

An instance of Net::FastCGI::Header.

parse

Parses a FCGI_Header.

Usage

    $header = Net::FastCGI::Header->parse($octets);

Arguments

$octets

A string of octets containing the header, must be greater than or equal to 8 octets in length.

Returns

$header

An instance of Net::FastCGI::Header.

METHODS

build

Usage

    $octets = $header->build;

Returns

$octets

A string of octets containing the header. String is 8 octets in length.

get_type

Usage

    $type = $header->get_type;

Returns

$type

An unsigned 8-bit integer.

get_request_id

Usage

    $request_id = $header->get_request_id;

Returns

$request_id

An unsigned 16-bit integer.

get_content_length

Usage

    $content_length = $header->get_content_length;

Returns

$content_length

An unsigned 16-bit integer.

get_padding_length

Usage

    $padding_length = $header->get_padding_length;

Returns

$padding_length

An unsigned 8-bit integer.

has_content

Usage

    $boolean = $header->has_content;

Returns

$boolean

A boolean indicating whether or not record has content.

has_padding

Usage

    $boolean = $header->has_padding;

Returns

$boolean

A boolean indicating whether or not record has padding.

to_string

Usage

    $string = $header->to_string;

Returns

$string

An ASCII string suitable for human consumption.

EXPORTS

None.

SEE ALSO

http://www.fastcgi.com/devkit/doc/fcgi-spec.html#S3.3
"build_header" in Net::FastCGI::Protocol
"parse_header" in Net::FastCGI::Protocol

AUTHOR

Christian Hansen chansen@cpan.org

COPYRIGHT

Copyright (c) 2008 Christian Hansen. All rights reserved.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.