I am new to grails and I am learning. I want to consume a webservice API(Rest). I searched for the example but didn't get a good one. My requirement is: The address to consume is eg:localhost:8080/order/createOrder; which will provide the JSON. My JSON format will be :
//and from JSON is:
username: 'abc',
password: 'xyz',
order: {
orderDate
orderNumber
subTotal
shipping
discount
netTotalPaid
creditApplied
transactionId
specialInstruction
}
I have to get the username,password and Order from JSON. Order is a Domain class where I will set the data from JSON.
Please suggest me with a detail explanation.
And if the JSON is not REST service,i.e.The application itself provides JSON as a service ? , if we don't need to consume a REST service ?