Jazz.net repo REST JSON request for query list returning 406 response
Aaron Allsbrook (71●2●5●7)
| asked Oct 29 '12, 1:44 p.m.
edited Oct 30 '12, 12:00 p.m. by Seth Packham (1.4k●4●22●13)
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
Anyone have an idea on what might up with this? Am I doing something wrong?
|
One answer
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. Comments
Aaron Allsbrook
commented Oct 30 '12, 1:14 p.m.
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).
|
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.