Jazz.net repo REST JSON request for query list returning 406 response
Hi All,
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.
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
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.
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.