curl java action

1
Please forgive my englsh;. i need to consume servises so i downloaded community commons lib and Rest services. how best can i put the following curl code in a java action. using post action at REST services module $ curl https://yoursite.desk.com/api/v2/cases \ -u email:password \ -X POST \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{"subject":"Test"}'
asked
1 answers
1

Hi Douglas,

If you import the RestServices Module and the Community Commons module into your project, you can exactly do this using the 'get' function. It will also parse the json for you if you setup your domain model correctly. See

Perform a get request: https://github.com/mendix/RestServices#get

Deserialize the json: https://github.com/mendix/RestServices#json-deserialization

Send the authentication data: https://github.com/mendix/RestServices#authentication

Edit: example of consuming a REST service can be found in this blog post

answered