curl java action

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 \ -u email:password \ -X POST \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{"subject":"Test"}'
1 answers

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:

Deserialize the json:

Send the authentication data:

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