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

NAME

ASP4::Request - Interface to the incoming request

SYNOPSIS

  if( my $cookie = $Request->Cookies('cust-email') ) {
    # Greet our returning user:
  }
  
  if( my $file = $Request->FileUpload('avatar_pic') ) {
    # Handle the uploaded file:
    $file->SaveAs( "/var/media/$Session->{user_id}/avatar/" . $file->FileName );
  }
  
  if( $Request->ServerVariables("HTTPS") ) {
    # We're under SSL:
  }

DESCRIPTION

The intrinsic $Request object provides a few easy-to-use methods to simplify the processing of incoming requests - specifically file uploads and cookies.

METHODS

Cookies( [$name] )

Returns a cookie by name, or all cookies if no name is provided.

ServerVariables( [$name] )

A wrapper around the global %ENV variable.

This means that:

  $Request->ServerVariables('HTTP_HOST')

is the same as:

  $ENV{HTTP_HOST}

FileUpload( $fieldname )

Returns a ASP4::FileUpload object that corresponds to the fieldname specified.

So...if your form has this:

  <input type="file" name="my_uploaded_file" />

Then you would get to it like this:

  my $upload = $Request->FileUpload('my_uploaded-file');

Header( $name )

Returns the value of an incoming http request header by the given name.

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.