I want to send a request as JSON and in my controller I want to parse this JSON and get the parameters I want. for example this is the request:
{"param1":"val1"}
I want to parse this request and get “param1” value. I used request.JSON but still I got null. Is there any other way to solve this?
Thanks,
Set it in your UrlMappings like this:
Search for parseRequest in latest Grails guide.
Then validate if it works correctly with curl: