NAME

PAGI::Context::HTTP - HTTP-specific context subclass

DESCRIPTION

Returned by PAGI::Context->new(...) when $scope->{type} is 'http'. Adds lazy accessors for PAGI::Request and PAGI::Response, plus an HTTP method accessor.

Inherits all shared methods from PAGI::Context.

METHODS

request

my $req = $ctx->request;

Returns a PAGI::Request instance. Lazy-constructed and cached.

response

my $res = $ctx->response;

Returns a PAGI::Response instance. Lazy-constructed and cached.

method

my $method = $ctx->method;    # 'GET', 'POST', etc.

Returns the HTTP method from the scope.

req

my $req = $ctx->req;

Alias for request.

resp

my $res = $ctx->resp;

Alias for response.

SEE ALSO

PAGI::Context, PAGI::Request, PAGI::Response