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

Jazz.net repo REST JSON request for query list returning 406 response

 Hi All,

I am making a call to get all queries associated with a particular project.  Using this as a reference https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Examples_AN2

The request for all queries defined against the project area RTC looks like
https://jazz.net/jazz/oslc/queries.json?oslc_cm.query=rtc_cm%3AprojectArea%3D%22_1w8aQEmJEduIY7C8B09Hyw%22

This pattern URL works fine for my RTC 3.0. and RTC 4.0 server environments but jazz.net gives me back a 406 as the response.  In the browser it returns a paged xml response of all possible queries even though json was requested.

Anyone have an idea on what might up with this?  Am I doing something wrong?

0 votes



One answer

Permanent link
Status code 406 (Not Acceptable) is described here:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

To summarize, the server is saying "I don't have any content types to give you that you would find acceptable". When a client makes a request, they should supply an "Accept" header to tell the server what content types (response formats) it can handle. The server then goes through the list until it finds one it knows how to write, and sends it. Here, either you didn't supply an Accept header, or the service isn't familiar with any of the content types you provided.

0 votes

Comments

Hi Curtis,


Thanks for the reply, I think I understand what the 406 is saying.  My request does expect a JSON response and for my production RTC and test RTC instances this request responds correctly.  For jazz.net the response is just completely empty.  I am curious as to why the jazz.net repository doesn't respond like other servers.  Is there something strange in the architecture that I can work around?

are you able to browse the above query in a browser and get a response?

Yes, I can get an XML response if I open the URL directly. However if I craft my own request with an Accept header for JSON, I get back a 500 Internal Server Error describing an error running the query, so it sounds like there is a bug in the service. I reported the bug here: OSLC query fails to return JSON on jazz.net (239073).

I can't reproduce the 406 error you're seeing.

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
× 10,948
× 480

Question asked: Oct 29 '12, 1:44 p.m.

Question was seen: 6,873 times

Last updated: Oct 30 '12, 1:31 p.m.

Confirmation Cancel Confirm