Getting Json response using the REST client
Ranjith Parameswaran (123●1●12●15)
| asked Jul 05 '12, 8:27 a.m.
retagged Jul 09 '12, 7:18 a.m. by Pramod Chandoria (2.1k●1●12●20)
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
This status code is usually used to indicate that you either didn't send an Accept header, or its value didn't match any of the available output formats of the resource. In plain English, either you didn't say what format you wanted or it doesn't have the one you asked for. Try sending a "Accept: application/json" header in your request.
Comments
Ranjith Parameswaran
commented Jul 05 '12, 11:23 a.m.
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. |
Thanks for the comments. I did try out with various header combinations, but was not able to get a response in json format using Location for simple query of Test Cases,Test plan or any other test artifacts.
Will raise a defect to follow this up.
Thanks!! |
Hi @ranparam json response is not supported for RQM's reportable rest API. The only format it supports is XML.
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
Albert Yao
commented Jul 09 '12, 5:32 a.m.
@Pramod Chandoria, Is JSON response supported by RTC? It seems that I encountered the similiar problem when I used the RTC REST API. |
Hello Pramod,
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. |
@Albert , See this link for RTC API https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI
I doubt RTC supports json response for public API |
Ranjith
I would retag it to RTC forum to get better answer from RTC expert |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.