-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate URL with query params? #28
Comments
There is not. Why would you want to do that instead of encoding them into the route itself? |
I could be convinced there's a better choice. I need to add an optional value to the generated URL - the login page takes a returlUrl query parameter, but it is not required. Also, I would prefer to encode this value as a query parameter, not part of the path, as it is optional and the page is the same. If there's already a way to do this I'm eager to hear about it. If not, I'm hopeful you'll consider making it a feature. |
Generating a URL via query params does work, but not in the way @cjohansen wants. (def routes
(silk/routes [[:foo [["bar" :herp] {"baz" :burp}]]]))
(silk/depart routes :foo {:herp "derp" :burp "kangaroo"})
;; "/bar/derp?baz=kangaroo" |
@cjohansen My sincere apologies for letting this slip through. I don't recall receiving a notification of your response. @levitanong Thanks for chiming in and drawing my attention. Would using |
Is there any way to generate a URL for a route with some additional query parameters? I would want to do something like
(silk/depart routes :login {} {:query {"returnUrl" "/somewhere"}})
, but AFAICT there's no way to feed query params intodepart
. Am I holding it wrong?The text was updated successfully, but these errors were encountered: