Joshua Darnell created OLINGO-1507:
--------------------------------------

             Summary: Allow Accept Header to be Empty
                 Key: OLINGO-1507
                 URL: https://issues.apache.org/jira/browse/OLINGO-1507
             Project: Olingo
          Issue Type: Improvement
          Components: odata4-client
    Affects Versions: (Java) V4 4.7.1
            Reporter: Joshua Darnell


When creating an {{ODataRawRequest}}, the Accept and Content-Type headers are 
automatically populated with defaults that cannot be overridden:

{{ Accept: application/json;odata.metadata=minimal}}
{{Content-Type: application/json;odata.metadata=minimal}}

While the {{Content-Type}} may be a reasonable thing to populate in this case, 
[since the OData specification requires 
it|http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-os-part1-protocol-complete.html#_Toc453752221],
 the {{Accept}} header isn't required to be supported by servers and, as such, 
clients MAY receive an HTTP 415 response when requesting XML Metadata from the 
/$metadata endpoint if {{Accept: application/xml}} is present in the request.

The requested behavior is that the Olingo client be allowed to set the accept 
value to "null" and have the header be removed from the corresponding request 
accordingly. The Olingo client library currently populates this header and it 
cannot be removed. 

Note that the {{XMLMetadataRequest}} object can have its {{Accept}} and 
{{Content-Type}} headers nulled currently (by adding them as empty custom 
headers) and it will remove the value, but doesn't remove the header from the 
request. Similarly, the Olingo client should present the ability to remove the 
Accept header from the XMLMetadataRequest completely as well.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to