Closed Happy-Monad closed 4 years ago
Hi @Happy-Monad, use the add the option :coerce :always
to get the behavior you want.
See https://github.com/dakrone/clj-http#output-coercion for more information
Thanks for that, I completely missed that line of the readme. I'll close the thread.
I'm using json output coercion with Chesire in conjunction with the
:throw-exceptions false
option. When the response is returned with a 2XX status code the body contents are being parsed, however upon exceptional status codes (404, 500) the response body is kept as a string. This is happening both withclient/get
,client/post
andclient/request
functions.I share below the dependencies, code and sample test server
Dependencies
[clj-http "3.10.1"] [cheshire "5.10.0"]
Code
Test server (Python3.7)