Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
(Java) V4 4.7.1
-
None
-
None
Description
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, 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.