mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
DELETE request drops the body #215
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@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 2, 2019):
I've added a
AllowBodyForAllHttpMethodsproperty in the settings.Please test MyGet version:
WireMock.Net.1.0.32-ci-11945.nupkg
@StefH commented on GitHub (Oct 5, 2019):
@AlexGhiondea ; did you have time to test?
@StefH commented on GitHub (Oct 9, 2019):
@AlexGhiondea ; did you have time to test this preview version?
@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
@StefH commented on GitHub (Oct 16, 2019):
@AlexGhiondea Did you have time to test this?
@StefH commented on GitHub (Oct 22, 2019):
@AlexGhiondea Can you please test and report your findings?
@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 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!!
@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.