akuk has asked for the wisdom of the Perl Monks concerning the following question:
Hi I am need to pass two parameters in the Dancer2 framework but unable to retrieve it from web page.
use Dancer2; use Dancer::Exception; use Plack::Builder; our $VERSION = '0.1'; # Enable JSON Serializer set serializer => 'JSON' get '/login:username:password' => sub { request->params; my %user = (); my $username = params->{username}; my $password = params->{password}; %user = ( user => { Name => $username, Pass => $password } ); return \%user; };
When I try to access it from the webpage http://localhost:5000?username=foo&password=bar I am getting 404 error. Did I messed up the perl code in the above app.pm package.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dancer2 Parameter Matching Failed
by Corion (Patriarch) on Jun 12, 2015 at 12:51 UTC | |
by akuk (Beadle) on Jun 13, 2015 at 03:40 UTC | |
by Corion (Patriarch) on Jun 13, 2015 at 07:11 UTC | |
|
Re: Dancer2 Parameter Matching Failed
by Anonymous Monk on Jun 13, 2015 at 07:34 UTC | |
|
Re: Dancer2 Parameter Matching Failed
by Anonymous Monk on Jun 13, 2015 at 01:30 UTC | |
by akuk (Beadle) on Jun 13, 2015 at 03:42 UTC | |
by Anonymous Monk on Jun 13, 2015 at 07:09 UTC |