Hello 1nickt++ and ++1nickt (even if we know this leads to an undefined behaviour..)

> The main problem you have with the posted code is that you are trying to retrieve the value of your body parameters with the method for retrieving query parameters.

> When you get data POSTed from a form, it's transported in the body of the HTTP request (in general, not specific to Dancer). Query parameters are those passed as the query string, e.g. /form?search_for=truth.

OMG i completely misunderstood the terminology and I repeat, docs have not helped me a lot. I was sure (nothing worst to be convinced of something wrong) that query parameters were these passed via POST and body ones were something defined in the body of the routes, like private variables..

My approsimative understanding of the web mechanism (i'd say underlying form) does not revealed immediatly to me that query parameters was for things passed via query in the URL like /form?search_for=truth and that body ones were reffered to the body of the incoming POSTed request.

I also misunderstood route parameters at first glance: i've tested them many times with URLS like /form?search_for=truth before understending that the correct way is:

get '/routeparam/:name?' => sub { # ok http://127.0.0.1:5000/routeparam/here_my_name "Hey " . route_parameters->get('name') . ", welcome here!"; };

All your others suggestions and contributions are precious for me.

I have already read all the docs you linked above but i'm even more convinced now that basic docs need some integrations for not already web developpers. As soon as I have got all these basic dance moves I'll make a pr for the doc part of Dancer2 probably for the main manual.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re^2: Dancer2 parameters understanding and usage by Discipulus
in thread Dancer2 parameters understanding and usage by Discipulus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.