Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELETE request drops the body #352

Closed
AlexGhiondea opened this issue Oct 1, 2019 · 10 comments
Closed

DELETE request drops the body #352

AlexGhiondea opened this issue Oct 1, 2019 · 10 comments
Assignees
Labels

Comments

@AlexGhiondea
Copy link

AlexGhiondea commented Oct 1, 2019

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
Copy link
Collaborator

StefH commented 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 added a commit that referenced this issue Oct 2, 2019
@StefH
Copy link
Collaborator

StefH commented 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
Copy link
Collaborator

StefH commented Oct 5, 2019

@AlexGhiondea ; did you have time to test?

@StefH
Copy link
Collaborator

StefH commented Oct 9, 2019

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

@AlexGhiondea
Copy link
Author

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
Copy link
Collaborator

StefH commented Oct 16, 2019

@AlexGhiondea Did you have time to test this?

@StefH
Copy link
Collaborator

StefH commented Oct 22, 2019

@AlexGhiondea Can you please test and report your findings?

@AlexGhiondea
Copy link
Author

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

@AlexGhiondea
Copy link
Author

@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
Copy link
Collaborator

StefH commented Oct 22, 2019

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

@StefH StefH closed this as completed Oct 22, 2019
StefH added a commit that referenced this issue Oct 22, 2019
@StefH StefH removed the question label Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants