{
my ($self, $c) = @_;
my $best_media_type = $c->req->choose_media_type('application/json', 'text/html');
}
sub choose :Local {
my ($self, $c) = @_;
my $body = $c->re
'no_match' => sub { 'none' },
'text/html' => sub { 'html' },
'application/json' => sub { 'json' });
$c->res->body($body);
}
sub filter : Local {
my ($self, $c) =
of the request to make decisions about what to do,
for example what format to return (HTML, XML, JSON, other). This role can
be applied to your L<Catalyst::Request> to add some useful helper methods