clj-http

2020-03-19T18:31:10.014800Z

Hey, just discovered this channel. I'm having a very interesting issue regarding query param encoding. Here's my issue. When I run this snippet...

(comment
  (require '[clj-http.client :as client])
  (require '[ring.util.codec])
  (client/get
    "<http://localhost>"
    {:query-params {:x "This is a test"}
     ;The default should be url encoded but it doesn't seem to be.
     ;Can't get anything else to do anything else.
     ;:content-type :application/x-www-form-urlencoded
     :debug?       true}))
...the resulting query params are encoded with hyphens for spaces rather than %20, like so: http://localhost?x=This+is+a+test. Any idea how to force url encoding?