1 package Catalyst::Action::Deserialize::YAML;
4 use namespace::autoclean;
5 use Scalar::Util qw(openhandle);
7 extends 'Catalyst::Action';
12 my ( $controller, $c, $test ) = @_;
14 my $body = $c->request->body;
19 if(openhandle $body) {
20 seek($body, 0, 0); # in case something has already read from it
21 while ( defined( my $line = <$body> ) ) {
30 $rdata = Load( $rbody );
35 $c->request->data($rdata);
38 'I would have deserialized, but there was nothing in the body!')
44 __PACKAGE__->meta->make_immutable;