Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Dancer2 Parameter Matching Failed

by Corion (Patriarch)
on Jun 12, 2015 at 12:51 UTC ( [id://1130188]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1130188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-24 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found