The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Blosxom::Plugin::Request - Object representing CGI request

SYNOPSIS

  package my_plugin;
  use strict;
  use warnings;
  use parent 'Blosxom::Plugin';

  __PACKAGE__->load_components( 'Request' );

  sub start {
      my $class = shift;
      my $method = $class->request->method; # GET
      my $page = $class->request->param( 'page' ); # 12
      my $id = $class->request->cookie( 'ID' ); # 123456
  }

  1;

DESCRIPTION

Object representing CGI request.

CLASS METHODS

Blosxom::Plugin::Request->init

Exports instance() into context class as request().

$request = Blosxom::Plugin::Request->instance

Returns a current Blosxom::Plugin::Request 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

Not implemented yet.

$request->path_info

Not implemented yet.

$request->date

Deprecated.

$request->flavour

Deprecated.

$request->cookie
  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 or HEAD.

$request->content_type

Returns the content_type of data submitted in a POST, generally multipart/form-data or application/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.