Closed erjoalgo closed 7 years ago
Morning.
The docs of api
describe all the options. Just to disable content negotiation, add :formats nil
. There are also options to disable all mws.
In case of slurping JSON bodys, after content negotiation, the parsed parameters are in :body-params
.
please reopen if this didn't help.
Actually, this didn't work for me. I've tried both coercion: nil
and :formats nil
. I also don't see the parsed parameters in :body-params
(I don't even have such a key). Do you have a short, complete example where coercion is disabled?
hi mate, do you even reach a solution?
the problem that I used a middleware to wrap wrap-json-body
which converts the body inputstream to a json, I don't know exactly how to stop slurp
since I have now a json not inputstream
This is a question.
I'm porting my "vanilla" compojure routes into compojure-api routes (ie replacing
[compojure.core :refer :all]
with[compojure.api.sweet :refer :all]
).Those routes whose handlers try to read the raw request body, via
(-> req :body slurp)
, now fail, since the body is empty. I imagine some middleware introduced by compojure.api.sweet has read the body earlier.How do I get raw access to the data within my handlers? Can I disable any pre-processing of the request body?
Sample example below: