Option to disable JSON deserialization (#434)

* Option to disable JSON deserialization

* Fix build errors, add test case

* make new parameter optional

* set default for contentType as well
This commit is contained in:
Stef Heyenrath
2020-03-05 17:59:24 +01:00
committed by GitHub
parent 87c4344d65
commit 88dd1b9aa4
14 changed files with 53 additions and 22 deletions

View File

@@ -243,9 +243,9 @@ namespace WireMock.Net.Tests.RequestMatchers
// assign
BodyData bodyData;
if (body is byte[] b)
bodyData = await BodyParser.Parse(new MemoryStream(b), null);
bodyData = await BodyParser.Parse(new MemoryStream(b), null, true);
else if (body is string s)
bodyData = await BodyParser.Parse(new MemoryStream(Encoding.UTF8.GetBytes(s)), null);
bodyData = await BodyParser.Parse(new MemoryStream(Encoding.UTF8.GetBytes(s)), null, true);
else
throw new Exception();