我正在使用 grails 3 rest-api 配置文件。我创建了生成的简单域类
@Resource(readOnly = false, formats = ['json', 'xml'])
class User {
String name
String address
Date dateOfBirth
}
同时http://localhost:8080/user/如果我尝试http://localhost:8080/user/1,会给我返回json用户列表。如果返回:
{"message":"Not Found","error":404}
什么给出了?
最佳答案
实际上我发现暴露的url是/user/show/1
由于 RestResource 自动公开基于 grails.rest.RestfulController 的 Controller ,您可以在该类中查找完整的方法列表
关于rest - grails 3 Rest-api 配置文件 GET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35432501/