clj-http 2022-03-02

how do you send body-params in a clj-http.client/post request?

This doesn’t seem to work:

(clj-http.client/post "" {:body {:email ""
                                                              :password "password"}
                                                })

but we have body-params in the server

we need body-params

:form-params is a standard way to do it. You will find them in :form-params in the ring request as well as :body-params.

:form-params definitely doesn’t work if you have the following in your reitit handler:

["/api/login" {:coercion spec/coercion
                  :post login-handler
                  :parameters {:body ::login-params}
                  }
you get a 400

Well, then it's specific to reitit or you are sending wrong params. Can you share the whole thing?