Fork me on GitHub
#beginners
<
2022-07-03
>
Ivan Koz09:07:34

Does anybody know how to set body key value to null in http-kit when providing a clojure map? Overwise I would use cheshire or data.json to provide a string.

{"defaultUserAttributes": null}

Martin Půda09:07:46

Did you try nil instead of null?

Ivan Koz09:07:49

I did and don't think it works because server returns unknown error and I'm not sure how to see what was sent, replacing map by cheshire output, works.

Bob B16:07:42

A quick echo server can show you what's being sent, but I think maybe a question would be what are you expecting to be sent? The http-kit docs recommend using 'your favorite encoder' to encode bodies/params. If the expectation is that http-kit will see a map and encode it to json, I think that might be where you're running into trouble. tl;dr if you want to send a json string, then using cheshire or data.json to create that json string would be the way to go afaik