Egg::Request - WEB request processing for Egg.
# The object is acquired. my $req= $e->request; # The query data is acquired specifying the name. my $data= $req->param('query_name'); # The mass of the query data is obtained. my $params= $req->params; # Passing the requested place is obtained. my $path= $req->path # Cookie is acquired specifying the name. my $cookie= $req->cookie('cookie_name'); # The mass of Cookie is acquired. my $cookies= $req->cookies; # The content of cookie is acquired. $cookie-E<gt>value is done at the same time. my $cookie_value= $req->cookie_value('cookie_name');
The WEB request processing for the Egg framework is done.
If mod_perl can be used, it is composed by Egg::Request::Apache system class though this module is usually composed in the shape succeeded to to Egg::Request::CGI.
Please set environment variable [PROJECT_NAME]_REQUEST_CLASS when you use another request class. Please look at the source of 'bin/dispatch.fcgi' about the use example. After Egg::Request::FastCGI is set to the environment variable in the BEGIN block, it starts.
The main body of this module is built into the component of the project.
The handler object of this module is returned.
Alias = req
Constructor. It is not necessary to call from the application.
my $req= $e->request;
The object that is basic of the processing of this module is returned. In a word, the object of CGI.pm or Apache::Request is restored.
The version of mod_perl is returned.
0 returns whenever it is not composed of the Egg::Apache system.
When the request method is GET, true is restored.
When the request method is POST, true is restored.
The request method returns and GET and POST return HEAD request and considering true when not is.
Please use 'request_method' or 'Method' when you want to check the request method in detail.
The mass of request query is returned by the HASH reference.
$e->parameters->{'query_name'};
Alias = params
When the argument is omitted, the list of the key to the request query is returned.
When KEY is given, the content of the corresponding request query is returned.
When VALUE is given, the request query is set.
my @key_list= $req->param; my $hoge= $req->param('hoge'); $req->param( hoge => 'boo' );
It relays it to $e->snip. Please look at the document of Egg::Util.
The data received with cookie is returned. The object of CGI::Cookie is restored.
while (my($key, $value)= each %{$req->cookies}) { $cookie{$key}= $value->value; }
The content of cookie specified with KEY is acquired.
It is necessary to use the value method further for obtaining data.
my $gao= $req->cookie('gao')->value;
This method doesn't support the set of the value.
Cookie returned with the response header must be used and set must use the cookie method of Egg::Response.
Cookie specified with KEY is returned and the result of receipt value is returned.
my $gao= $req->cookie_value('gao');
Passing information on the requested place is returned.
The content of environment variable REMOTE_USER is returned.
Alias = user
The content of environment variable SCRIPT_NAME is returned.
The content of environment variable REQUEST_URI is returned.
The content of environment variable PATH_INFO is returned.
The content of environment variable HTTP_REFERER is returned.
Alias = referer
The content of environment variable HTTP_ACCEPT_ENCODING is returned.
Alias = accept_encoding
The content of environment variable REMOTE_ADDR is returned.
Default is '127.0.0.1'.
Alias = addr
The content of environment variable REQUEST_METHOD is returned.
Default is GET.
Alias = method
The content of environment variable SERVER_NAME is returned.
Default is localhost.
The content of environment variable SERVER_SOFTWARE is returned.
Default is cmdline.
The content of environment variable SERVER_PROTOCOL is returned.
Default is 'HTTP/1.1'.
Alias = protocol
The content of environment variable HTTP_USER_AGENT is returned.
Default is local.
Alias = agent, user_agent
The content of environment variable SERVER_PORT is returned.
Default is 80.
Alias = port
True is returned if the request is due to SSL.
The URI scheme when requesting it is returned.
It composes of information that receives requested URI again and it returns it.
Alias = url
Host information on the requested client is returned. Remote_addr is returned when not obtaining it.
Host information on the WEB server under operation is returned.
When the port number is included in the content of host, the value in which it is excluded is returned.
The received content is output to STDOUT.
The response status is returned from Egg::Response as a receipt result code.
When the response status is undefined or 200, 0 is always returned.
Egg::Release Egg::Request::CGI, Egg::Request::FastCGI, Egg::Request::Apache, Egg::Base, ModPerl::VersionUtil, URI
Masatoshi Mizuno <lushe@cpan.org>
Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>.
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.6 or, at your option, any later version of Perl 5 you may have available.
To install Egg::Release, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Egg::Release
CPAN shell
perl -MCPAN -e shell install Egg::Release
For more information on module installation, please visit the detailed CPAN module installation guide.