in reply to Dancer2 Parameter Matching Failed

Where did you find this syntax for the request and what does it do?

get '/login:username:password' => sub {

Maybe you wanted to just use

get '/login' => sub {

Replies are listed 'Best First'.
Re^2: Dancer2 Parameter Matching Failed
by akuk (Beadle) on Jun 13, 2015 at 03:40 UTC

    I have found this usage on http://search.cpan.org/~sukria/Dancer2-0.01/lib/Dancer2/Manual.pod

    Under " NAMED MATCHING A route pattern can contain one or more tokens (a word prefixed with ':'). Each token found in a route pattern is used as a named-pattern match. Any match will be set in the params hashref."

      I think the documentation is misleading here. Only elements of the path can be matched this way, with / as delimiter. So you will need:

      get '/login/:username/:password' => sub { ...

      But you should consider that such a GET request will need Javascript for logging in to the site, where a normal form submission will not need Javascript.