on class, which we don't have an instance of, ewwwww
# Also, naughty modules like Catalyst::View::JSON try to write to _everything_,
# so spit a warning, ignore that (and try to do the right thing any
=>'HashRef',
builder=>'_build_normalized');
sub _build_normalized {
return +{
JSON => 'application/json',
JS => 'application/javascript',
PERL => 'application/perl',
HTML => 'tex
sub start : POST Chained('/') CaptureArg(0) { ... }
sub is_json : Chained('start') Consumes('application/json') { ... }
sub is_urlencoded : Chained('start') Consumes('applicat
form-data') { ... }
## Alternatively, for common types...
sub is_json : Chained('start') Consume(JSON) { ... }
sub is_urlencoded : Chained('start') Consumes(UrlEncoded) { ...
tempt to encode C<application/json> since the two most commonly used
approaches (L<Catalyst::View::JSON> and L<Catalyst::Action::REST>) have already configured
their JSON encoders to produce properly
nses. If you are rolling your
own JSON encoding, you may need to set the encoder to do the right thing (or override
the global regular expression to include the JSON media type).
=head2 Encoding wit