John Drago > Apache2-ASP-2.46 > Apache2::ASP::Response

Download:
Apache2-ASP-2.46.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  2
View/Report Bugs
Source  

NAME ^

Apache2::ASP::Response - Outgoing response object.

SYNOPSIS ^

  return $Response->Redirect("/another.asp");
  
  return $Response->Declined;
  
  $Response->End;
  
  $Response->ContentType("text/xml");
  
  $Response->Status( 404 );
  
  # Make this response expire 30 minutes ago:
  $Response->Expires( -30 );
  
  $Response->Include( $Server->MapPath("/inc/top.asp"), { foo => 'bar' } );
  
  my $html = $Response->TrapInclude( $Server->MapPath("/inc/top.asp"), { foo => 'bar' } );
  
  $Response->AddHeader("content-disposition: attachment;filename=report.csv");
  
  $Response->Write( "hello, world" );
  
  $Response->Clear;
  
  $Response->Flush;

DESCRIPTION ^

Apache2::ASP::Response offers a wrapper around the outgoing response to the client.

PUBLIC PROPERTIES ^

ContentType( [$type] )

Sets/gets the content-type response header (i.e. text/html, image/gif, etc).

Default: text/html

Status( [$status] )

Sets/gets the status response header (i.e. 200, 404, etc).

Default: 200

Expires( [$minutes] )

Default 0

ExpiresAbsolute( [$http_date] )

Declined( )

Returns -1.

Cookies( )

Returns all outgoing cookies for this response.

Headers( )

Returns all outgoing headers for this response.

IsClientConnected( )

Returns true if the client is still connected, false otherwise.

PUBLIC METHODS ^

Write( $str )

Adds $str to the response buffer.

Redirect( $path )

Clears the response buffer and sends a 301 redirect to the client.

Throws an exception if headers have already been sent.

Include( $path, \%args )

Executes the script located at $path, passing along \%args. Output is included as part of the current script's output.

TrapInclude( $path, \%args )

Executes the script located at $path, passing along \%args, and returns the response as a string.

AddCookie( $name => $value )

Adds a cookie to the header.

AddHeader( $name => $value )

Adds a header to the response.

DeleteHeader( $name )

Removes an outgoing header.

Throws an exception if headers have already been sent.

Flush( )

Sends any buffered output to the client.

Clear( )

Clears the outgoing buffer.

End( )

Closes the connection to the client and terminates the current request.

Throws an exception if headers have already been sent.

BUGS ^

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

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

HOMEPAGE ^

Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.

AUTHOR ^

John Drago <jdrago_999@yahoo.com>

COPYRIGHT ^

Copyright 2008 John Drago. All rights reserved.

LICENSE ^

This software is Free software and is licensed under the same terms as perl itself.

syntax highlighting: