File: Status.pm

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (42 lines) | stat: -rw-r--r-- 814 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package TestApp::Controller::Engine::Response::Status;

use strict;
use base 'Catalyst::Controller';

sub begin : Private {
    my ( $self, $c ) = @_;
    $c->response->content_type('text/plain');
    return 1;
}

sub s200 : Relative {
    my ( $self, $c ) = @_;
    $c->res->status(200);
    $c->res->output("200 OK\n");
}

sub s400 : Relative {
    my ( $self, $c ) = @_;
    $c->res->status(400);
    $c->res->output("400 Bad Request\n");
}

sub s403 : Relative {
    my ( $self, $c ) = @_;
    $c->res->status(403);
    $c->res->output("403 Forbidden\n");
}

sub s404 : Relative {
    my ( $self, $c ) = @_;
    $c->res->status(404);
    $c->res->output("404 Not Found\n");
}

sub s500 : Relative {
    my ( $self, $c ) = @_;
    $c->res->status(500);
    $c->res->output("500 Internal Server Error\n");
}

1;