https://pact.io logo
#pact-net
Title
# pact-net
m

Matt (pactflow.io / pact-js / pact-go)

03/17/2022, 9:05 AM
I’m not a .NET person, but do you need to explictly serialise the JSON there? I think you can pass the object directly into
WithJsonBody
c

Cyrus Devnomad

03/17/2022, 9:32 AM
Thank you very much, indeed passing the actual object instead of the serialized object did i! Now the mock provider accepts and verifies the parameter in the request body:
Copy code
var productNameObj = new { productName = "ProductX" };
...
.WithJsonBody(productNameObj)
🙌 1
7 Views