GX::HTTP::Parser::Body

Module Version: 0.2000_01

NAME

GX::HTTP::Parser::Body - HTTP message body parser base class

SYNOPSIS

None.

DESCRIPTION

This module provides the GX::HTTP::Parser::Body class which extends the GX::Class::Object class.

METHODS

Constructor

new

Returns a new parser object or undef if the specified content type is not supported.

$parser = GX::HTTP::Parser::Body->new( %attributes );
Attributes:
  • content_type ( string ) [ required ]

    Supported content types:

    • application/x-www-form-urlencoded
    • multipart/form-data
  • discard_uploads ( bool )

    A boolean flag indicating whether or not to discard uploads. Defaults to false.

  • tmp_dir ( string )

    A path to the directory that should be used to store temporary data.

Returns:
Exceptions:

Public Methods

parse

Takes a body object, parses its content and returns a reference to a hash with the result, or returns undef if the body cannot be parsed.

$result = $parser->parse( $body );
Arguments:
Returns:
  • $result ( HASH reference | undef )

    $result = {
    parameters => $parameters, # GX::HTTP::Parameters object
    parts => \@parts, # ARRAY reference containing HASH references
    uploads => $uploads # GX::HTTP::Uploads object
    };

    Any value of the result hash may be undef.

AUTHOR

Jörg A. Uzarek <uzarek@runlevelnull.de>

COPYRIGHT AND LICENSE

Copyright © 2009-2011 Jörg A. Uzarek.

This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.