![]() |
![]()
| ![]() |
![]()
NAMEDancer::HTTP - helper for rendering HTTP status codes for Dancer VERSIONversion 1.3520 DESCRIPTIONHelper for rendering HTTP status codes for Dancer METHODSstatus( $status )Returns the numerical status of $status. # all three are equivalent, and will return '405' $x = Dancer::HTTP->status( 405 ); $x = Dancer::HTTP->status( 'Method Not Allowed' ); $x = Dancer::HTTP->status( 'method_not_allowed' ); codesReturns a hashref of all HTTP status known to "Dancer". The keys are the numerical statuses and the values their string equivalents. print Dancer::HTTP->codes->{404}; # prints 'File Not Found' HTTP CODESThe following codes/aliases are understood by any status() call made from a Dancer script. The aliases can be used as-is (e.g., Moved Permanently), or as lower-case string with all non-alphanumerical characters changed to underscores (e.g., moved_permanently). get '/user/:user' => sub { my $user = find_user( param('user') ); unless ( $user ) { status 404; # or could be status 'not_found'; # or even status 'Not Found'; } ... }; Processed Codes
Redirections
Problem with request
Problem with server
AUTHORThis module has been written by Alexis Sukrieh <sukria@cpan.org> SOURCE CODEThe source code for this module is hosted on GitHub <https://github.com/PerlDancer/Dancer> LICENSEThis module is free software and is published under the same terms as Perl itself. AUTHORDancer Core Developers COPYRIGHT AND LICENSEThis software is copyright (c) 2010 by Alexis Sukrieh. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|