1 package Catalyst::Action::Deserialize::XML::Simple;
4 use namespace::autoclean;
6 extends 'Catalyst::Action';
9 $VERSION = eval $VERSION;
13 my ( $controller, $c, $test ) = @_;
19 $c->log->debug("Could not load XML::Simple, refusing to deserialize: $@")
24 my $body = $c->request->body;
26 my $xs = XML::Simple->new('ForceArray' => 0,);
29 $rdata = $xs->XMLin( "$body" );
34 if (exists($rdata->{'data'})) {
35 $c->request->data($rdata->{'data'});
37 $c->request->data($rdata);
41 'I would have deserialized, but there was nothing in the body!')
47 __PACKAGE__->meta->make_immutable;