Created
March 8, 2010 05:40
-
-
Save ysasaki/324903 to your computer and use it in GitHub Desktop.
Mojolicious - change response code and content_type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::Example; | |
use strict; | |
use warnings; | |
use base 'Mojolicious::Controller'; | |
sub default { | |
my $self = shift; | |
# to text/plain | |
$self->res->headers->content_type('text/plain'); | |
# change status code | |
$self->res->code(403); | |
$self->render_text('403 in plain text'); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment