krasserm / grails-jaxrs

JAX-RS Plugin for Grails
http://code.google.com/p/grails-jaxrs/
Apache License 2.0
50 stars 48 forks source link

How to output the POST request content? #49

Closed stefaniebrunner closed 8 years ago

stefaniebrunner commented 10 years ago

Hi, do you know how I can print or get out the content of a json-formatted POST request? My API received a json, but I don't know exactly how the structure of that json is. I tried a lot but I always reveive an error (a message body reader for Java class ... and Java type class was not found). What can I do to find out what is in the request body? Thanks a lot.

davidecavestro commented 10 years ago

I'd try declaring a Map parameter in the resource method - instead of your specific type - then see the map contents.

stefaniebrunner commented 10 years ago

yes thanks, that was what I was looking for. Now I've got another problem. I have a POST request like

@POST @Path('/check') Response checkLocation(Map loc) { . . ok 'something'
}

if I don't have to respond an object, only to say all is fine with Status ok. How can I do that? All i tried to write after the "ok" I get the error message: HandlerInterceptor.afterCompletion throw exception cannot create a session after the response has been committed

Does anybody know what is wrong?

budjb commented 8 years ago

This issue was moved to budjb/grails-jaxrs#14