<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: RestAPI: Content-Type header should not be required for GET (Thread)</title><description> Using the v6.0 RestAPI, and trying to GET data from Spira  in json-format, the API requires that the Content-Type header is set to application/json.  Clearly, it should be the Accept header that should be conveyed with the application/json value.   Example:    curl --user  :  -H Accept: application/json https://spiraservice.net/Services/v6_0/RestService.svc/projects/9/releases   returns a 400 Bad request error  while:   curl --user  :  -H Content-Type: application/json https://spiraservice.net/Services/v6_0/RestService.svc/projects/9/releases   returns a 200 OK with the requested data.    Why does it matter?    Trying to send a GET request with a Content body (required to set the content-header) using a .NET HttpClient, throws:  ProtocolViolationException {Cannot send a content-body with this verb-type.}  Getting Microsoft to change this behavior is probably not possible, but the Spira API should correctly handle the Accept header instead of the Content-Type header here.          </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spirateam/issues-questions/2828.aspx</link><item><guid isPermaLink="false">threadId=2828</guid><author>Björn Lundmark (bjorn@distributedmedical.com)</author><title>RestAPI: Content-Type header should not be required for GET</title><description> Using the v6.0 RestAPI, and trying to GET data from Spira  in json-format, the API requires that the Content-Type header is set to application/json.  Clearly, it should be the Accept header that should be conveyed with the application/json value.   Example:    curl --user  :  -H Accept: application/json https://spiraservice.net/Services/v6_0/RestService.svc/projects/9/releases   returns a 400 Bad request error  while:   curl --user  :  -H Content-Type: application/json https://spiraservice.net/Services/v6_0/RestService.svc/projects/9/releases   returns a 200 OK with the requested data.    Why does it matter?    Trying to send a GET request with a Content body (required to set the content-header) using a .NET HttpClient, throws:  ProtocolViolationException {Cannot send a content-body with this verb-type.}  Getting Microsoft to change this behavior is probably not possible, but the Spira API should correctly handle the Accept header instead of the Content-Type header here.          </description><pubDate>Thu, 13 Jul 2023 09:57:49 -0400</pubDate><a10:updated>2023-07-13T10:24:11-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/2828.aspx</link></item><item><guid isPermaLink="false">messageId=6158</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> It is because we are using a Microsoft WCF to implement the web service layer and we have to dynami</title><description> It is because we are using a Microsoft WCF to implement the web service layer and we have to dynamically support both JSON and XML, so we need to use the Content-Type header to know which to use.  So unfortunately were also limited by Microsoft as well ;-) </description><pubDate>Thu, 13 Jul 2023 10:24:11 -0400</pubDate><a10:updated>2023-07-13T10:24:11-04:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/2828.aspx#reply6158</link></item></channel></rss>