In Python I would do the following:
>>> q = urllib.urlencode({\"q\": \"clojure url\"})
>>> q
\'q=clojure+url\'
>>> url = \"http://sta
Here's one way:
user=> (import [java.net URLEncoder])
java.net.URLEncoder
user=> (str "http://stackoverflow.com/search?q=" (URLEncoder/encode "clojure url" "UTF-8"))
"http://stackoverflow.com/search?q=clojure+url"
I know this is not exactly the same as your Python snippet though. Please see the following post from the Clojure mailing list for a more complete answer:
http://www.mail-archive.com/clojure@googlegroups.com/msg29338.html
The code from there will allow you to do this:
user=> (encode-params {"q" "clojure url"})
"q=clojure+url"