John Drago > ASP4-1.087 > ASP4::HTTPContext

Download:
ASP4-1.087.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source  

NAME ^

ASP4::HTTPContext - Provides access to the intrinsic objects for an HTTP request.

SYNOPSIS ^

  use ASP4::HTTPContext;
  
  my $context = ASP4::HTTPContext->current;
  
  # Intrinsics:
  my $request   = $context->request;
  my $response  = $context->response;
  my $session   = $context->session;
  my $server    = $context->server;
  my $config    = $context->config;
  my $stash     = $context->stash;
  
  # Advanced:
  my $cgi = $context->cgi;
  my $r = $context->r;

DESCRIPTION ^

The HTTPContext itself is the root of all request-processing in an ASP4 web application.

There is only one ASP4::HTTPContext instance throughout the lifetime of a request.

PROPERTIES ^

current

Returns the ASP4::HTTPContext object in use for the current HTTP request.

request

Returns the ASP4::Request for the HTTP request.

response

Returns the ASP4::Response for the HTTP request.

server

Returns the ASP4::Server for the HTTP request.

session

Returns the ASP4::SessionStateManager for the HTTP request.

stash

Returns the current stash hash in use for the HTTP request.

config

Returns the current ASP4::Config for the HTTP request.

cgi

Provided Just In Case - returns the CGI object for the HTTP request.

r

Provided Just In Case - returns the Apache2::RequestRec for the HTTP request.

NOTE: Under ASP4::API (eg: in a unit test) $r will be an instance of ASP4::Mock::RequestRec instead.

BUGS ^

It's possible that some bugs have found their way into this release.

Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=ASP4 to submit bug reports.

HOMEPAGE ^

Please visit the ASP4 homepage at http://0x31337.org/code/ to see examples of ASP4 in action.

syntax highlighting: