简体   繁体   中英

Rest APIS - HTTP Delete - Request body gets ignored/dropped WSO2 API Manager

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.

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.

Update

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM