Reputation: 41
Environment :- Web Service - Rest APIs. Media Type - JSON. JAX RS implementation - Jersey. HTTP Methods - POST, GET, PUT & DELETE. WSO2 API Gateway Manager - To sit on top of it to publish these APIs.
Problem :- The delete operation has a request body(a json message) which has input values in it. When I hit the services directly - the whole operation performs successfully. But once I go through the API Manager (using the URL that it publishes) - the request body seems to be getting dropped/ignored & hence the operation fails. Rest all the operations are working fine & so is the OAuth too.
Can someone please help me - as to why is the the request body (a json message) is getting discarded when I go through the WSO2 API gateway manager - and what can I do to get it working, please !!
Thanks in advance.
Upvotes: 0
Views: 2269
Reputation: 32468
HTTP DELETE opration isn't supposed have body. You can check here and here
Many frameworks discourage using it or warn you that the body may be dropped. The reason is that you want to DELETE some resource identified by your URI thus no body should be required.
WSO2 API Manager depends on Apache HttpComponents/HttpCore library for this functionality and this issue is fixed in their 5.0 which isn't released yet.
You can find the JIRA here reported against httpCode library.
Upvotes: 2