Getting Json response using the REST client
Hello,
I was using the rest add-on in mozilla and was working with the article "How to consume the Rational Team Concert change management service", but every time i create a header to get response in json format i get an error "Status Code: 406 Not Acceptable".
Can i get guidance on how to get a json response. Thanks in advance
7 answers
Comments
Hello Curtis,
Thanks for the answer. I had added the accept header as mentioned above "Accept: application/json" .Everytime i add this header the response would be in the form "Status Code: 406 Not Acceptable".
if i remove the headers ie, do not specify the format in which i need the response, i get a response in xml format.
Hello,
was playing around with the API's and found, when we use the URL
to query all the testcases , i dont get a json response but if we use a url that is more specific to a artifact as
"https://Jazz_team_server:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_87QhAL_AEeGRTIg3pl5i3w/testcase/urn:com.ibm.rqm:testcase:7
" i did get a json response.
Is there any restriction as such?
Comments
I'm not sure why you're seeing this - it might require text/json instead of application/json. I had a quick look at one OSLC spec and saw application/json but I'm not familiar with the specific one you're using. I recommend looking at the spec to see exactly what it supports and how you do content negotiation. If it doesn't work as it says it's supposed to, then that would be a bug in the service and you should file a defect.
You can also use RQM's OSLC QM API and response should be often in RDF.
In either case RQM doen't support json response for public API,
Comments
@Pramod Chandoria, Is JSON response supported by RTC? It seems that I encountered the similiar problem when I used the RTC REST API.
Please refer the below link:
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#GetRepresentations
it talks about the resource representations. Can you please check the same and let me know if i have missed out any information or point me to some article/references that explains the resource representation in a better way.
I doubt RTC supports json response for public API