1
votes

I'm using ring-json. In defining my app, I'm doing this:

  (wrap-json-params)
  (wrap-json-body)
  (wrap-json-response)

and in my routes, I have this:

  (POST "/messages" {params :params session :session} (process-message params session))

where the process-message function doesn't do anything but println right now. When I post json data to the route, I'm seeing the data in an error, but can't figure out why I'm getting the error:

java.lang.IllegalArgumentException: Cannot open <{"var1" "hey", "var2" "ho"}> as an InputStream.

Any help would be greatly appreciated...

2
Did you set application/json as the content-type on the request?Alex
This is in my request header: "Content-Type" = "application/json; charset=utf-8";pickwick

2 Answers

3
votes

You cannot have both wrap-json-params and wrap-json-body, wrap-json-params is an alternative to wrap-json-body , try removing wrap-json-param!

0
votes

Well, I still don't know why I was getting the error, but things work properly when I use ring-middleware-format instead of ring-json.