I'm learning grails (2.4.0) right now and have a weird problem with automatically generated REST methods.
So, i have a simple domain
@Resource(uri = '/unit', formats = ['json'])
class Unit {
String name;
}
I can successfully list/create/delete instances with GET/POST/DELETE methods, but PUT method does nothing:
curl -i -X PUT -H "Content-Type: application/json" -d '{"name":"fail", "id":65}' localhost:8080/app/unit/65
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Location: http://localhost:8080/app/unit/65
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Sun, 01 Jun 2014 09:25:02 GMT
{"class":"app.Unit","id":65,"name":"test"}
subsequent GET requests will also return name:test instead of name:fail
What i can be doing wrong?