https://localhost:9443/jts/process/project-areas
I'm trying to use this REST webservice, but I'm not sure what I should use as Content-Type and Accept in the request header.
If I'm using it without any request header, then I get the php code of the homepage back. So how can I check what request header I should set? In this document, it is mentioned application/xml, but that doesnt improve the situation. https://jazz.net/wiki/bin/view/Main/DraftTeamProcessRestApi#GET_project_areas_collection |
8 answers
Hello,
This is what we use in the tests for that service: Content-Type is application/xml;charset=UTF-8 Accept-Charset is UTF-8 Accept is application/xml Regards, Martha I'm trying to use this REST webservice, but I'm not sure what I should use as Content-Type and Accept in the request header. |
Thanks for your answer. I tried everthing that you suggested, but I still don't get the correct result:
public void getRootService() throws ClientProtocolException, IOException { This generates the following result: { But if I use a REST Client plugin for firefox, I get the correct results with the same headers. I can't see an error in my code. |
Thanks for your answer. I tried everthing that you suggested, but I still don't get the correct result: This response looks like the json response to a user query. Are you sure the projectURL returned from the xml parser is like this: https://localhost:9443/jts/process/project-areas? Dancy |
Thanks for your answer. I tried everthing that you suggested, but I still don't get the correct result: This response looks like the json response to a user query. Are you sure the projectURL returned from the xml parser is like this: https://localhost:9443/jts/process/project-areas? Dancy Yes I am sure. If I test this URL with a REST plugin for firefox it returns the correct XML document. |
Yes I am sure. If I test this URL with a REST plugin for firefox it returns the correct XML document.
Can you try to get the status code? And have you passed the authentication? |
Yes I am sure. If I test this URL with a REST plugin for firefox it returns the correct XML document. Can you try to get the status code? And have you passed the authentication? The status Code is 200. And I think that I have passed the authentication. I have the following cookies after the authentication: JSESSIONID : 5AB83AF30B70DDC12F8583541C8A393E And this is the header of the subsequent test GET to the REST: Server: Apache-Coyote/1.1 |
Hello,
I am not sure if it matters, but our tests are also setting a header named X-com-ibm-team-userid to the user id. Martha Yes I am sure. If I test this URL with a REST plugin for firefox it returns the correct XML document. Can you try to get the status code? And have you passed the authentication? The status Code is 200. And I think that I have passed the authentication. I have the following cookies after the authentication: JSESSIONID : 5AB83AF30B70DDC12F8583541C8A393E And this is the header of the subsequent test GET to the REST: Server: Apache-Coyote/1.1 |
Yes I am sure. If I test this URL with a REST plugin for firefox it returns the correct XML document. Can you try to get the status code? And have you passed the authentication? The status Code is 200. And I think that I have passed the authentication. I have the following cookies after the authentication: JSESSIONID : 5AB83AF30B70DDC12F8583541C8A393E And this is the header of the subsequent test GET to the REST: Server: Apache-Coyote/1.1 Have you tried setting these cookies in the request header? I don't see this in your code. And you may need to pass SSO session id as well. Dancy |
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.