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.