Java & REST API question
![]()
I am writing a Java program which will get the xml of a workitem. After authentication when I try to get the work item (https://localhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/99.xml)
and I always get the user info in json format as descried here
https://jazz.net/forum/questions/64839/httpslocalhost9443jtsprocessproject-areas
I am using http client 4.3.3
I am able to get xml using curl as well as REST client for Firefox
Anyone has any idea why I get my user info in json format?
|
Accepted answer
![]()
Karthik
There are Java samples in the OSLC workshop https://jazz.net/library/article/635 Karthik Krishnan selected this answer as the correct answer
Comments Thanks. I tried the example and it worked. I have no idea what is wrong with my code as it is almost identical except that I am using HTTP Client 4.3.3.
thanks anyway
|
Comments
Which headers are you including to your rest call?
Accept = application/xml or aaplication/json
I also see that you add .xml at the end of your url. You dont need to do that.
I already have it