1 package Catalyst::Action::Deserialize::JSON;
4 use namespace::autoclean;
6 extends 'Catalyst::Action';
7 use JSON qw( decode_json );
11 my ( $controller, $c, $test ) = @_;
13 my $body = $c->request->body;
17 while (my $line = <$body>) {
23 my $rdata = eval { decode_json( $rbody ) };
27 $c->request->data($rdata);
30 'I would have deserialized, but there was nothing in the body!')