I use httpkit as http client. I try many solutions to make the header Content-Type
be application/json
, but all failed.
Here is my code:
(require '[org.httpkit.client :as http])
(http/post
url
{ :query-params {"q" "foo, bar"}
:form-params {"q" "foo, bar"}
:headers {"Content-Type" "application/json; charset=utf-8"}})
Post with the code above would get response status 200
but Content-Type
is application/x-www-form-urlencoded
.
And if delete the line application/x-www-form-urlencoded
, would get response status 400
.
PS: I take flask as web server.