Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

 

 

1 vote



7 answers

Permanent link
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.

0 votes

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.


Permanent link


Hello,

 

was playing around with the API's and found, when we use the URL

https://jazz_team_server:9443/qm/oslc_qm/contexts/_87QhAL_AEeGRTIg3pl5i3w/resources/com.ibm.rqm.planning.VersionedTestCase

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?

0 votes

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.


Permanent link


Hello curtis,

 

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!!

0 votes


Permanent link
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,

0 votes

Comments

@Pramod Chandoria, Is JSON response supported by RTC? It seems that I encountered the similiar problem when I used the RTC REST API.


Permanent link
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.

0 votes


Permanent link
@Albert , See this link for RTC API https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI
I doubt RTC supports json response for public API

0 votes


Permanent link
Ranjith
I would retag it to RTC forum to get better answer from RTC expert

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Jul 05 '12, 8:27 a.m.

Question was seen: 12,854 times

Last updated: Jul 09 '12, 7:18 a.m.

Confirmation Cancel Confirm