[Dancer-users] params for post route not working

David Precious davidp at preshweb.co.uk
Mon Feb 20 11:54:04 CET 2012


On Sun, 19 Feb 2012 23:20:48 +0000
GJ <gj at freeshell.org> wrote:

> Hi all,
> 
> I am using Dancer 1.3092 .  I can't access or use params for post
> routes, eg
> 
> ----
> post '/login' => sub {
>     # Validate the username and password they supplied
>     if (params->{user} eq 'bob' && params->{pass} eq 'a') {
>         session user => params->{user};
>         redirect params->{path} || '/';
>     } else {
>         redirect '/login?failed=1';
>     }
> };
> ----
> 
> The above example is from the documentation, the result is the `else'
> redirection. I tried my own code also.  params->user is empty, in
> fact if I dump all `params' its empty.  

Interesting.  Can you dump the request object returned by the
'request' keyword so we can see what Dancer got?



-- 
David Precious ("bigpresh") <davidp at preshweb.co.uk>
http://www.preshweb.co.uk/     www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedin    www.preshweb.co.uk/facebook
www.preshweb.co.uk/cpan        www.preshweb.co.uk/github


More information about the Dancer-users mailing list