This is the second part of my question on converting cURL to Java The first part is titled:
Converting cURL authentication to Java and retrieving & updating data using REST XML (Pt.1)
Third, how can I implement update, create, and delete for the api in Java? For example:
- Update:
curl -i -X PUT -H "Content-Type:application/xml" -H "Accept: application/xml" -d "<ticket><description>Take this description</description></ticket>" http://user:password@www.assembla.com/spaces/my_space_id/tickets/1
- Delete"
curl -i -X DELETE -H "Accept: application/xml" http://user:password@www.assembla.com/spaces/my_space_id/tickets/1
- Create:
curl -i -X POST -H "Content-Type:application/xml" -H "Accept: application/xml" -d "<ticket><summary>This is a Summary</summary><priority>3</priority></ticket>" the weblink
In other words, how can I convert these cURL code into Java?
I would really appreciate your help. Also, a good reference to do such stuff in Java will be awesome too.
Thanks.