Igor Zinovyev > Eve > Eve::HttpRequest::Psgi

Download:
Eve-0.06.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Eve::HttpRequest::Psgi - an HTTP request adapter for the PSGI interface.

SYNOPSIS ^

    use Eve::HttpRequest::Psgi;

    my $request  = Eve::HttpRequest->new(
        uri_constructor => sub { return Eve::Uri->new(@_); },
        env_hash => $env_hash);

    my $uri = $request->get_uri();
    my $method = $request->get_method();
    my $param = $request->get_parameter(name => 'some_parameter');
    my @param_list = $request->get_parameter(name => 'some_list');
    my $cookie = $request->get_cookie(name => 'some_cookie');

    my $upload_hash = $request->get_upload(name => 'huge_file');

DESCRIPTION ^

The class adapts some functionality of the Plack::Request module.

Constructor arguments

uri_constructor

a code reference returning a newly constructed URI

env_hash

an environment hash that is supplied to an application by a PSGI handler.

METHODS ^

init()

get_uri

Returns an URI instance built from an HTTP request URI.

get_method

Returns an HTTP method name.

get_parameter()

Returns a request parameter value or a list of values for a specified parameter name. When called in a scalar context, will return a single value, which for a multivalue parameter will result in a first value of the list:

    my $parameter_value = $request->get_parameter(name => 'some');

To receive a list of all values for a multivalue parameter, call the method in a list context:

    my @parameter_value_list = $request->get_parameter(name => 'some');

Arguments

name

get_upload()

Returns a hash containing information about an uploaded file. This hash will have tempname, size and filename keys, values for which represent the temporary file path, its size in bytes and the original name of the file.

Arguments

name

get_parameter_hash()

Returns a hash reference with the requested parameter values.

get_cookie()

Returns a request cookie value for a specified name.

Arguments

name

SEE ALSO ^

CGI
Eve::Class
Eve::Uri

LICENSE AND COPYRIGHT ^

Copyright 2012 Igor Zinovyev.

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

See http://dev.perl.org/licenses/ for more information.

AUTHORS ^

Sergey Konoplev
Igor Zinovyev
syntax highlighting: