[Dancer-users] params for post route not working

Perlover perlover at perlover.com
Mon Feb 20 12:46:36 CET 2012


Hello,

I think this problem can be related with this my pull request:

https://github.com/sukria/Dancer/pull/702

This pull request is not realized but from this bug the Dancer cannot
get HTTP Headers under PSGI invocation (for example under Starman).
A POST requests use a HTTP Headers for param getting and if http
headers are empty request object can return undefined POST parameters

2012/2/20 David Precious <davidp at preshweb.co.uk>:
> 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
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>


More information about the Dancer-users mailing list