Once I post JSON data to a url in Grails, how can I get access to that data inside of the controller?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Grails automatically parses/unmarshals the JSON and you can access it via
request.JSONin your controller. The object returned is of typeJSONObjectand thus allows map-style access to the properties. You can also directly use this JSONObject for data binding: