![]() |
![]()
| ![]() |
![]()
NAMEWebDAO::Response - Response classSYNOPSYSnew WebDAO::Response:: cv => $cv DESCRIPTIONClass for make HTTP responseMETHODSget_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 strprint_headerprint header.return $self referenceredirect2url <url for redirect to> [, $code]Set headers for redirect to url.return $self referenceset_cookie ( name => <cookie_name>, value=><cookie_value> ...)Set cookie. return $self referenceset_callback(sub1{}[, sub2{} ..])Set callbacks for call after flushsend_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 answererror404Set HTTP 404 headerswantformat ['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()" calledMust return : string - output format, i.e. 'html', 'xml' undef - unknown ( use defaults ) set_emptySet flag for empty response. Headers are not printed. return $selfis_emptyCheck is response cleared. Return 1|0SEE ALSOhttp://webdao.sourceforge.netAUTHORZahatski Aliaksandr, <zag@cpan.org>COPYRIGHT AND LICENSECopyright 2002-2012 by Zahatski AliaksandrThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|