mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-05-31 04:00:42 +02:00
Improve matcher for BodyType.MultiPart #208
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 @davidshen84 on GitHub (Sep 6, 2019).
ref: https://github.com/WireMock-Net/WireMock.Net/blob/2f406029c983cfefab920a7f5b10f29b9ad337cc/src/WireMock.Net/Matchers/Request/RequestMessageBodyMatcher.cs#L130
Based on the above code, a body which is detected as BodyType.MultiPart will not be tested by an
IStringMatcher.Because all HTTP bodies are plain text, I think it is quite safe to use an
IStringMatcherto test the content of a MultiPart body.For example, a MultiPart body that looks like below after encoded.
One can use a string matcher to test if a string "test file content" is presented.
@davidshen84 commented on GitHub (Sep 6, 2019):
Not working if there are binary data :(