![]() |
![]()
| ![]() |
![]()
NAMEWebDAO::Response - Response class SYNOPSYSnew WebDAO::Response:: cv => $cv DESCRIPTIONClass for make HTTP response METHODSget_requestReturn ref to request object (WebDAO::CV) set_status INTset response HTTP status $r->set_status(200) return $self set_header NAME, VALUESet out header: $response->set_header('Location', $redirect_url); $response->set_header( 'Content-Type' => 'text/html; charset=utf-8' ); return $self reference get_header NAMEreturn value for header NAME: aliases for headerscontent_type $r->content_type('text/html; charset=utf-8'); content_length A decimal number indicating the size in bytes of the message content. get_mime_for_filename <filename>Determine mime type for filename (Simple by ext); return str print_headerprint header.return $self reference redirect2url <url for redirect to> [, $code]Set headers for redirect to url.return $self reference set_cookie ( name => <cookie_name>, value=><cookie_value> ...)Set 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'); flushFlush current state of response. set_modalSet modal mode for answer error404Set 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 ($cv)Method for detect output format when wantformat() called Must return : string - output format, i.e. 'html', 'xml' undef - unknown ( use defaults ) set_emptySet flag for empty response. Headers are not printed. return $self is_emptyCheck is response cleared. Return 1|0 SEE ALSOhttp://webdao.sourceforge.net AUTHORZahatski Aliaksandr, <zag@cpan.org> COPYRIGHT AND LICENSECopyright 2002-2012 by Zahatski Aliaksandr This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|