question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to send a body with DELETE method

See original GitHub issue

Hi 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ptrthomascommented, Apr 20, 2017

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.

0reactions
ptrthomascommented, Apr 26, 2017

conversation moved to pull request #49

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is an entity body allowed for an HTTP DELETE request?
So it's not explicitly allowed or disallowed, and there's a chance that a proxy along the way might remove the message body (although...
Read more >
Unable to send body with a DELETE request #162 - GitHub
I've created a PR that might fix this, but don't have a good example to test it (since few APIs will accept a...
Read more >
REST - Should you use a body for your HTTP DELETE ...
User Karmic Coder reports that a lot of clients used to send HTTP requests are unable to send a DELETE with a body,...
Read more >
DELETE - HTTP - MDN Web Docs
The HTTP DELETE request method deletes the specified resource. Request has body, May. Successful response has body, May. Safe, No. Idempotent ...
Read more >
DELETE method request can't include body
DELETE method request can't include body. Hi, I am very pleased to use SoapUI. But, I found the tool can't send a DELETE...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found