【发布时间】:2015-08-31 09:43:12
【问题描述】:
我是 grails 新手,我正在学习。我想使用 Web 服务 API(Rest)。 我搜索了这个例子,但没有得到一个好的例子。 我的要求是: 要消费的地址是 eg:localhost:8080/order/createOrder;它将提供 JSON。 我的 JSON 格式将是:
//and from JSON is:
username: 'abc',
password: 'xyz',
order: {
orderDate
orderNumber
subTotal
shipping
discount
netTotalPaid
creditApplied
transactionId
specialInstruction
}
我必须从 JSON 中获取用户名、密码和订单。 Order 是一个 Domain 类,我将从 JSON 中设置数据。
请给我一个详细的解释。
如果 JSON 不是 REST 服务,即应用程序本身提供 JSON 作为服务? ,如果我们不需要使用 REST 服务?
【问题讨论】:
标签: json rest grails grails-2.3