Hi am developing my first grails RESTful application… In that i have mapped the post request to save method.its showing some error like, Internal server Error..Can any one please help me to brief how to use the post method to save the data via REST Post request…?
My save method is as follows..
def save = {
def xml = request.XML
def post = new ImageProperties()
post.content = xml.content.text()
def markup
if (post.save()) { markup = { status("OK") } }
else { markup = { status("FAIL") } }
render contentType: "text/xml; charset=utf-8", markup } }
and ImageProperties class as follows…
class ImageProperties {
static hasMany={categories:Categories}
String name
String place
String description
String path
String category
Categories categories
}
Hi after a long trial and error method i found the answer.. Hope this will be helpful for many users…