NAME
Blosxom::Plugin::Request - Object representing CGI request
SYNOPSIS
use Blosxom::Plugin::Request;
my $request = Blosxom::Plugin::Request->instance;
my $method = $request->method; # GET
my $path_info = $request->path_info; # /foo/bar.html
my $flavour = $request->flavour; # rss
my $page = $request->param( 'page' ); # 12
my $id = $request->cookie( 'ID' ); # 123456
DESCRIPTION
Object representing CGI request.
CLASS METHODS
- Blosxom::Plugin::Request->begin
-
Exports
instance()
into context class asrequest()
. - $request = Blosxom::Plugin::Request->instance
-
Returns a current Blosxom::Header object instance or create a new one.
- $request = Blosxom::Plugin::Request->has_instance
-
Returns a reference to any existing instance or
undef
if none is defined.
INSTANCE METHODS
- $request->base
-
$blosxom::url
- $request->path_info
-
$blosxom::path_info
- $request->date
-
$request->date->{year}; # $blosxom::path_info_yr $request->date->{month}; # $blosxom::path_info_mo_num $request->date->{day}; # $blosxom::path_info_da
- $request->flavour
-
$blosxom::flavour
-
my $id = $request->cookie( 'ID' ); # 123456
- $request->param
-
my $value = $request->param( 'foo' ); my @values = $request->param( 'foo' ); my @fields = $request->param;
- $request->method
-
Returns the method used to access your script, usually one of
POST
,GET
orHEAD
. - $request->content_type
-
Returns the content_type of data submitted in a POST, generally
multipart/form-data
orapplication/x-www-form-urlencoded
. - $request->referer
-
Returns the URL of the page the browser was viewing prior to fetching your script. Not available for all browsers.
- $request->remote_host
-
Returns either the remote host name, or IP address if the former is unavailable.
- $request->user_agent
-
Returns the
HTTP_USER_AGENT
variable. If you give this method a single argument, it will attempt to pattern match on it, allowing you to do something like:if ( $request->user_agent('Mozilla') ) { ... }
- $request->address
-
Returns the remote host IP address, or
127.0.0.1
if the address is unavailable (REMOTE_ADDR
). - $request->user
-
Returns the authorization/verification name for user verification, if this script is protected (
REMOTE_USER
). - $request->protocol
-
Returns the protocol (HTTP/1.0 or HTTP/1.1) used for the current request.
- $request->upload
-
Returns Blosxom::Plugin::Request::Upload objects.
my $upload = $request->upload( 'field' ); my @uploads = $request->upload( 'field' ); my @fields = $request->upload;
- $request->is_secure
-
Returns a Boolean value telling whether connection is secure.
- $request->header
-
Returns the value of the specified header.
my $requested_language = $request->header( 'Accept-Language' );
SEE ALSO
Blosxom::Plugin, Plack::Request, Class::Singleton
AUTHOR
Ryo Anazawa
LICENSE AND COPYRIGHT
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.