Symptom
The status "405 Method Not Allowed" was received when making a query to an OData API. In addition, the response body could also display: The specified HTTP method is not allowed for the resource identified by the Data Service Request URI.
Environment
SAP Cloud for Customer
Reproducing the Issue
- Query an OData API with the OPTIONS or HEAD method.
- The response status is "405 Method Not Allowed".
- Meanwhile, the response body is empty or "The specified HTTP method is not allowed for the resource identified by the Data Service Request URI".
Cause
OData API does not support the OPTIONS and HEAD methods.
Resolution
Please do not send the OPTIONS or HEAD request to the OData service. If it's required to send such a preflight request to the OData service, please use a GET request to achieve it.
See Also
Keywords
OData, OData API, OPTIONS, HEAD, 405, 405 Method Not Allowed , KBA , LOD-CRM-INT-API , OData API (C4C Only) , Problem