Continuity::Request - Simple HTTP::Request-like API for requests inside Continuity


Continuity documentation  | view source Contained in the Continuity distribution.

Index


NAME

Top

Continuity::Request - Simple HTTP::Request-like API for requests inside Continuity

SYNOPSIS

Top

  sub main {
    my $request = shift;
    $request->print("Hello!");
    $request->next;

    # ...

    $name = $request->param('name');
  }

METHODS

Top

$request->next

Suspend execution until a new Web request is available.

$val = $request->param('name');

@vals = $request->param('name');

@vals = $request->param('name1', 'name2');

Fetch a CGI POST/GET parameter.

If there is more than one parameter with the given name, then scalar context gets the first instance and list context gets all of them. Providing multiple param names will return the values for each (and if one of the params has multiple values then it will be confusing!).

Calling the param method with no parameters is equivalent to calling the params method.

%params = $request->params();

@params = $request->params();

Get a list of all key/value pairs. Repeated values are included, but if you treat it like a hash it will act like one.

$request->print("Foo!<br>");

Write output (eg, HTML).

Since Continuity juggles many concurrent requests, it's necessary to explicitly refer to requesting clients, like $request->print(...), rather than simply doing print ....

$request->uri;

Straight from HTTP::Request, returns a URI object. (Probably not yet supported by the FastCGI adapter.)

$request->method;

Returns 'GET', 'POST', or whatever other HTTP command was issued. Continuity currently punts on anything but GET and POST out of paranoia.

$request->send_headers("X-HTTP-Header: blah\n", $h2)

Send this in the headers

INTERNAL METHODS

Top

$request->send_basic_header;

Continuity does this for you, but it's still part of the API of Continuity::Request objects.

$request->end_request;

Ditto above.

$request->send_static;

Controlled by the staticp => sub { ... } argument pair to the main constructor call to Continuity->new().

DESCRIPTION

Top

This module contains no actual code. It only establishes and documents the interface actually implemented in Continuity::Adapt::FCGI, Continuity::Adapt::HttpDaemon, and, perhaps eventually, other places.

SEE ALSO

Top

Continuity
Continuity::Adapt::FCGI
Continuity::Adapt::HttpDaemon
Continuity::RequestCallbacks

Continuity documentation  | view source Contained in the Continuity distribution.