Routing issues #2301
Replies: 3 comments 7 replies
|
Hi there. Based on your example I suspect that the fault lies not in the route definition but somewhere else. Unless you do anything in particular with the request parameters in the request processing the endpoint should see them exactly the same. As far as I know there are only a few that are handled by the framework specifically, like In your particular case I would go through the request flow step by step and see if the variable is tampered with somewhere (a route hook perhaps?). In addition I would make sure that the originator of the request construct the url correctly. Like, try it using |
|
Well i figured it out, it wasn't mojolicious at all, i was doing curl to test this with and apparently because & is special character i needed to wrap it in '';
|
|
Try this the URL parameters you can access as param values, the rest are seen in the same vain as form data, aka in the validation input. Note that if possible, it is a good idea to add patterns to the URL parameters, then users will get a 404 if the values does not match the pattern. AFAIK there are also URL parameters that "take the rest", but the "?..." stuff has special meaning, so not sure if it would catch it. |
Uh oh!
There was an error while loading. Please reload this page.
I use name routes, trying to create a dynamic one and running into troubles:
nested route
$api_auth->get('/getSearch/:tenant_id/:searchby')->to(controller => 'Controller::API', action => 'getSearch');my url I am trying to do
https://myurl.com/api/getSearch/1/byid?value=1&limit=1It makes it to the getSearch subroutine, but it will not see the limit param, it does see the value=1. I have tried a few things but i cannot seem to make it accept the &key=value that would be in a GET request.
All reactions