Using wget
I make two posts to the same url with xml in the body. The first works. The second has the content type specified and it does not work. Why is this an
With content type specified content will be received as part of request body instead of parsed params.
Body can be accessed as request.XML
in action. Going through the comments, we found out the usage of a older way to bindData
. With Grails 2.3.*, the request payload can be directly bound to a domain object provided the body has a valid id
as :
def save(MyDomain abc){
//use abc.name
}
If a valid id is not present in request body then domain object will be null inside the action.
@Data binding.