Unable to send a body with DELETE method
See original GitHub issueHi Peter, I have recently started using Karate and I am loving it so far. Because, I have extensive experience in using Cucumber before and I feel right at home with Karate. Kudos !!! Although, I realised that the karate ignores the body passed with a DELETE request. I know this is a standard practise jn the RESTful services world and it is a recommended approach. But, the API that I am testing has made a conscious decision to not follow it based on our circumstances. In our case we have ‘relationship’ resource which does not have an ID because it doesn’t have a existence on it’s own. Hence in our case, we make a DELETE request to this resource with a BODY. Please find below a sample request:
Scenario: Validate body is passed with a DELETE request
Given path ‘document1’, ‘relationships’
And request
“”"
<Relationships> <Relationship TypeID="VALID" TargetDocumentId="document1"/> </Relationships>
“”"
When method DELETE
Then status 200
What is your opinion about making the request BODY optional for DELETE method. Meaning pass the ENTITY for a DELETE request if it is present or else just make the request without it. Currently, I am using patched version of Karate and Jersey Client which allows me to do this. If you are inclined towards doing it, I would be happy to share my patch.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
yes, I don’t see a problem with this, do submit a patch ! thanks for helping out with the other questions as well, really appreciate it.
conversation moved to pull request #49