DELETE request drops the body #215

Closed
opened 2025-12-29 14:25:23 +01:00 by adam · 10 comments
Owner

Originally created by @AlexGhiondea on GitHub (Oct 1, 2019).

Originally assigned to: @StefH on GitHub.

It looks like for a DELETE request the body is not parsed.

I looked at the history but couldn't figure out if there was a reason why for a DELETE the body is not parsed/matched?

I am writing tests that depend on the DELETE request sending a body and this makes it tricky to test.

The fix can be as easy as flipping this to true, however I am not sure what the side effects could be.
https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Util/BodyParser.cs#L36

Originally created by @AlexGhiondea on GitHub (Oct 1, 2019). Originally assigned to: @StefH on GitHub. It looks like for a DELETE request the body is not parsed. I looked at the history but couldn't figure out if there was a reason why for a DELETE the body is not parsed/matched? I am writing tests that depend on the DELETE request sending a body and this makes it tricky to test. The fix can be as easy as flipping this to `true`, however I am not sure what the side effects could be. https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Util/BodyParser.cs#L36
adam added the feature label 2025-12-29 14:25:23 +01:00
adam closed this issue 2025-12-29 14:25:23 +01:00
Author
Owner

@StefH commented on GitHub (Oct 1, 2019):

I see your point.
For mocking and testing purposes, it would be better to just allow all, or make this configurable with settings.

@StefH commented on GitHub (Oct 1, 2019): I see your point. For mocking and testing purposes, it would be better to just allow all, or make this configurable with settings.
Author
Owner

@StefH commented on GitHub (Oct 2, 2019):

I've added a AllowBodyForAllHttpMethods property in the settings.

Please test MyGet version:
WireMock.Net.1.0.32-ci-11945.nupkg

@StefH commented on GitHub (Oct 2, 2019): I've added a `AllowBodyForAllHttpMethods` property in the settings. Please test MyGet version: WireMock.Net.1.0.32-ci-11945.nupkg
Author
Owner

@StefH commented on GitHub (Oct 5, 2019):

@AlexGhiondea ; did you have time to test?

@StefH commented on GitHub (Oct 5, 2019): @AlexGhiondea ; did you have time to test?
Author
Owner

@StefH commented on GitHub (Oct 9, 2019):

@AlexGhiondea ; did you have time to test this preview version?

@StefH commented on GitHub (Oct 9, 2019): @AlexGhiondea ; did you have time to test this preview version?
Author
Owner

@AlexGhiondea commented on GitHub (Oct 9, 2019):

Hey
I apologize for the delay.I just saw your messages.

Thanks for adding that!

I will give it a try later today!!

Thanks,
Alex

@AlexGhiondea commented on GitHub (Oct 9, 2019): Hey I apologize for the delay.I just saw your messages. Thanks for adding that! I will give it a try later today!! Thanks, Alex
Author
Owner

@StefH commented on GitHub (Oct 16, 2019):

@AlexGhiondea Did you have time to test this?

@StefH commented on GitHub (Oct 16, 2019): @AlexGhiondea Did you have time to test this?
Author
Owner

@StefH commented on GitHub (Oct 22, 2019):

@AlexGhiondea Can you please test and report your findings?

@StefH commented on GitHub (Oct 22, 2019): @AlexGhiondea Can you please test and report your findings?
Author
Owner

@AlexGhiondea commented on GitHub (Oct 22, 2019):

@StefH I didn’t get around to test this yet. I will give it a try at lunch today!

@AlexGhiondea commented on GitHub (Oct 22, 2019): @StefH I didn’t get around to test this yet. I will give it a try at lunch today!
Author
Owner

@AlexGhiondea commented on GitHub (Oct 22, 2019):

@StefH I wasn't able to get the package from the feed, so I cloned and built locally your PR. With that, the tests that require a body for a DELETE operation work if you specify that setting!

Thanks for making the change! I will update my version once you release!!

@AlexGhiondea commented on GitHub (Oct 22, 2019): @StefH I wasn't able to get the package from the feed, so I cloned and built locally your PR. With that, the tests that require a body for a DELETE operation work if you specify that setting! Thanks for making the change! I will update my version once you release!!
Author
Owner

@StefH commented on GitHub (Oct 22, 2019):

Thank you for testing this. I will merge this PR to master, keep a watch on the official NuGet packages.

@StefH commented on GitHub (Oct 22, 2019): Thank you for testing this. I will merge this PR to master, keep a watch on the official NuGet packages.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#215