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