query string params appear in the params of the request:
(GET "/math" {params :params} []
(get params :a) ;; 1
(get params :b) ;; 2
... etc
they will be keywords as above if you are using the
wrap-keyword-params handler, otherwise strings.
the syntax you are using above is for pulling values out of the url:
(GET "/math/:command" [command]
(str "<p>" command "</p>"))
"/math/some-value" => "<p>some-value</p>"
the docs have more info on these things:
https://github.com/weavejester/compojure/wiki/Routes-In-Detail
hope that helps...
On Wed, May 18, 2011 at 5:24 AM, finbeu <[email protected]> wrote:
> Hi
>
> I don't know how to extract the query string from a route. I guess it
> is pretty simply but I don't get it.
>
> http://localhost:8080/math/add?a=1&b=2&c=3
>
> I quess they can be retrieved somehow with :query-string keyword? But
> I have no clue how.
>
> (GET "/math/:command" [command & more] ....????
>
> Thanks for your help.
>
> FB
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en