_as(JSON => {
error => 1,
error_description => $msg->toString,
}, {
content_type => 'application/json; charset=UTF-8',
});
};
ยป example: Return JSON res
lication/json
fatal_handler sub {
my ($dsl, $msg, $reason, $default) = @_;
(my $ctype = $dsl->request->header('content-type')) =~ s/;.*//;
return if $ctype ne 'application/json';
s
or' : 'Bad Request';
$dsl->send_as(JSON => {
error => 1,
description => $msg->toString,
}, {
content_type => 'application/json; charset=UTF-8',
});
};
=item $