Reputation: 61
I've implemented an application using Moqui Framework.I can able to get json response by the bellow url
http://localhost:8080/moqui/rest/s1/moqui/users
now i need to insert data into table how can i do that. In moqui.rest.xml i have resource in that method is there like bellow
method type="post" service name="org.moqui.impl.UserServices.create#UserAccount" /method
for this i need a url that can insert data in to table.
Upvotes: 0
Views: 187
Reputation: 123
I tried to implement the very same functionality. I used cURL on Windows laptop (one endpoint) which was communicating to instance of Moqui (the other endpoint, the one with the /moqui/users service itself). This is what I did:
This is the sample data and the cURL command itselft. Watch out for syntax in Windows, the single quotas can mess it up. That is the reason, why the data is stored in file.
curl -X POST -u john.doe:moqui --header "Content-Type:application/json" --header "Accept:text/html" -d "@body.json" http://localhost/rest/s1/moqui/users
{"username":"edward","newPassword":"BhsmsAv1^^^.","newPasswordVerify":"BhsmsAv1^^^.","requirePasswordChange":"N","userFullName":"Edward Bolt","emailAddress":"[email protected]","currencyUomId":"EUR","locale":"sk","timeZone":"CET"}
Put this user data into file and name it body.json. Then run the command, there is a reference to body.json file. Hope this helps.
Upvotes: 0