NAME

WebDAO::Response - Response class

DESCRIPTION

Class for set response headers

METHODS

set_header NAME, VALUE

Set out header:

$response->set_header('Location', $redirect_url);
$response->set_header( -type => 'text/html; charset=utf-8' );

return $self reference

get_header NAME

return value for header NAME:

get_mime_for_filename <filename>

Determine mime type for filename (Simple by ext); return str

print header.return $self reference

redirect2url <url for redirect to>

Set headers for redirect to url.return $self reference

Set cookie. For params see manpage for CGI::cookie. return $self reference

set_callback(sub1{}[, sub2{} ..])

Set callbacks for call after flush

send_file <filename>|<file_handle>|<reference to GLOB> [, -type=><MIME type string>]

Prepare headers and save

$respose->send_file($filename, -type=>'image/jpeg');

flush

Flush current state of response.

set_modal

Set modal mode for answer

error404

Set HTTP 404 headers

wantformat ['format',['forse_set_format']]

Return expected output format: defauilt html

# return string for format
$r->wantformat()

Check if desired format is expected

#$r->wantformat('html') return boolean
if ($r->wantformat('html')) { 
    # 
}

Force set desired format:

$r->wantformat('html'=>1); #return $response object ref

detect_wantformat ($session)

Method for detect output format when wantformat() called

Must return :

string  - output format, i.e. 'html', 'xml'
undef - unknown ( use defaults )

SEE ALSO

http://webdao.sourceforge.net

AUTHOR

Zahatski Aliaksandr, <zag@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2002-2010 by Zahatski Aliaksandr

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.