Mock Server request matching - use request body as well

My question:
Is it possible to configure a Mock Server to also match by request body, not only by Url?
This is not mentioned in the docs, and I can confirm with the latest version, the differences in the bodies of two examples with the same Url are ignored.

Hi @a.f,

It sounds like what you’re looking for is the optional request header x-mock-match-request-body - if you send this with value true then the request body will be included in the comparison.

The header is mentioned very briefly in the documentation linked below:

Please let me know if it’s not functioning in the way that you’d hope, or if your problem is slightly different.

@neilstudd Tahnk you!

It’s in the right direction, but it doesn’t work yet :slight_smile: . I’m getting “no matching request.”

This is the body I have defined in the example:

{
    "Prop1":"{{Prop1_Valid}}",
    "Prop2":"{{Prop2_Valid}}"
}

How is the body matched? binary wise, character wise or by parsing the json properties?
If it is matched binary or character wise, it will almost never match since the request will be dependent on the json serializer that I use.

I’m glad it’s getting you somewhere, although I think you’re now moving beyond the realms of my experience :smiley: Hopefully someone else can help to get you over the finish line!