From: Chris Cormack Date: Mon, 3 Mar 2014 19:36:21 +0000 (+1300) Subject: Trying to handle posts with no parameters better in the Dancer app X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=78c9a1d64c917bcaa535888b88bf47d46b420118;p=working%2FNCIPServer.git Trying to handle posts with no parameters better in the Dancer app --- diff --git a/lib/NCIP/Dancing.pm b/lib/NCIP/Dancing.pm index 11e8197..8b65bc8 100644 --- a/lib/NCIP/Dancing.pm +++ b/lib/NCIP/Dancing.pm @@ -5,11 +5,14 @@ our $VERSION = '0.1'; use NCIP; - -any ['get', 'post'] => '/' => sub { +any [ 'get', 'post' ] => '/' => sub { my $ncip = NCIP->new('t/config_sample'); - my $xml = param 'xml'; + my $xml = param 'xml'; + if ( request->is_post ) { + $xml = request->body; + } my $content = $ncip->process_request($xml); + warn $content; template 'main', { content => $content }; };