Creating a ticket via POST using OSLC v2 using C# web api
Hi everyone,
I've got a little problem trying to create a new ticket in RTC. I'm using forms authentication using an implementation shown here: https://nkumar83.wordpress.com/2013/06/13/consuming-rtc-rational-team-concert-oslc-apis-using-c-post-1-authentication/
Up until now I've only had to use the GET and PUT methods for my calls to RTC, which have worked fine. I'm now trying to send a POST request to have a new ticket created. My code can successfully iterate the root services doc and work it's way through to find the creation factory URL for a ticket, in this case I'm working with unclassified tickets. The URL that my code has picked out is 100% the correct path as I've tested manually via Firefox using RESTClient. In fact, using the RESTClient I can create a ticket manually.
I'm using the HttpWebRequest method in my code to build up a request for the RTC server. However when I make the call the RTC server is sending back a list of tickets. I can reproduce this behaviour manually if I set the RESTClient to use GET instead of POST against the creation factory URL.
It's as though the RTC server for whatever reason wants to send data back for a GET request rather than process as a POST.
I'm at a loss as to why this is happening.
Project details:
ASP.NET C# Web Api
OSLC v2
Setting headers for accept and content type as: application/rdf+xml
Any advice or pointers would be appreciated as I'm completely stuck.
Thanks.
I've got a little problem trying to create a new ticket in RTC. I'm using forms authentication using an implementation shown here: https://nkumar83.wordpress.com/2013/06/13/consuming-rtc-rational-team-concert-oslc-apis-using-c-post-1-authentication/
Up until now I've only had to use the GET and PUT methods for my calls to RTC, which have worked fine. I'm now trying to send a POST request to have a new ticket created. My code can successfully iterate the root services doc and work it's way through to find the creation factory URL for a ticket, in this case I'm working with unclassified tickets. The URL that my code has picked out is 100% the correct path as I've tested manually via Firefox using RESTClient. In fact, using the RESTClient I can create a ticket manually.
I'm using the HttpWebRequest method in my code to build up a request for the RTC server. However when I make the call the RTC server is sending back a list of tickets. I can reproduce this behaviour manually if I set the RESTClient to use GET instead of POST against the creation factory URL.
It's as though the RTC server for whatever reason wants to send data back for a GET request rather than process as a POST.
I'm at a loss as to why this is happening.
Project details:
ASP.NET C# Web Api
OSLC v2
Setting headers for accept and content type as: application/rdf+xml
Any advice or pointers would be appreciated as I'm completely stuck.
Thanks.
One answer
Take a look at this article instead.
https://jazz.net/library/article/1001
If you are still having the problem, post the link of your POST operation, and the response header/body of the operation.
https://jazz.net/library/article/1001
If you are still having the problem, post the link of your POST operation, and the response header/body of the operation.