Skip to content
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

Nested query params #623

Open
jmurp opened this issue Oct 11, 2022 · 0 comments
Open

Nested query params #623

jmurp opened this issue Oct 11, 2022 · 0 comments

Comments

@jmurp
Copy link

jmurp commented Oct 11, 2022

deps

{:deps {
        org.clojure/clojure {:mvn/version "1.11.1"}
        clj-http/clj-http   {:mvn/version "3.12.3"}
        cheshire/cheshire   {:mvn/version "5.11.0"}}}

code

(require '[clj-http.client :as client])

(client/post "http://localhost:3000" {:debug true :as :json :query-params {:items [{:key1 "value"}]}})

The resulting query string (decoded) is items={:key1+"value"}
I am looking for items[0][key1]=value

Is this expected?

result

{:user-info nil,
 :use-header-maps-in-response? true,
 :body-type nil,
 :as :json,
 :debug true,
 :headers {"accept-encoding" "gzip, deflate"},
 :server-port 3000,
 :url "http://localhost:3000",
 :flatten-nested-keys (:query-params),
 :uri "",
 :server-name "localhost",
 :query-string "items=%7B%3Akey1+%22value%22%7D",
 :body nil,
 :scheme :http,
 :request-method :post}
HttpRequest:
{:config nil,
 :method "POST",
 :requestLine
 #object[org.apache.http.message.BasicRequestLine 0x749ad37c "POST http://localhost:3000?items=%7B%3Akey1+%22value%22%7D HTTP/1.1"],
 :aborted false,
 :params
 #object[org.apache.http.params.BasicHttpParams 0xce19c86 "[parameters={}]"],
 :protocolVersion
 #object[org.apache.http.HttpVersion 0x4fd3b20a "HTTP/1.1"],
 :URI
 #object[java.net.URI 0x158e6fc2 "http://localhost:3000?items=%7B%3Akey1+%22value%22%7D"],
 :class org.apache.http.client.methods.HttpPost,
 :allHeaders
 [#object[org.apache.http.message.BasicHeader 0x4213bc3e "Connection: close"],
  #object[org.apache.http.message.BasicHeader 0x97beeaf "accept-encoding: gzip, deflate"]],
 :entity nil}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant