blob: 4f0960f298d838efbd0bc76590c1a359ce1123b1 (
plain) (
blame)
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
|
package presque::Role::Response;
use Moose::Role;
before get => sub {
(shift)->_set_response_content_type;
};
before put => sub {
(shift)->_set_response_content_type;
};
before post => sub {
(shift)->_set_response_content_type;
};
before delete => sub {
(shift)->_set_response_content_type;
};
sub _set_response_content_type {
my $self = shift;
$self->response->header('Content-Type' => 'application/json');
}
1;
|