Thank you for the response. It’s not the return data that’s the issue for us. It’s that when we send variable POST data to the mock server, such as a timestamp, it doesn’t match any examples and we get a 404 back. Is there a way around this, or do we need to match POST data exactly?
Would you be able to provide an example of what you’re sending, what the example is and what the response is please?
Is it a dynamic variable or a static value stored in a variable scope?
Are the timestamps in the examples dynamic values or just static values. Do you have certain timestamps set in the examples for returning different data sets?
Just trying to build up more of a picture about the setup as I can’t see what you have in front of you.
I don’t think this works with “Response matching” → “Request body” turned on. It seems like when I turn this on, there’s no way to have the mock server respond to anything but exactly defined sets of variables. For instance, if I send any timestamp that isn’t explicitly set in an example, the mock server will respond with a 404.
This gets at the heart of what I’m trying to figure out. Is there a way to have request body matching turned on and still send data that doesn’t exactly match examples?
This works and returns a 200:
curl -i -X POST https://XXXXXX.mock.pstmn.io/data1 --header ‘Content-Type: application/json’ -d ‘{“time”: 1728682300, “other”: 1111}’
This doesn’t because the time no longer matches. This returns a 404:
curl -i -X POST https://XXXXXX.mock.pstmn.io/data1 --header ‘Content-Type: application/json’ -d ‘{“time”: 1728682311, “other”: 1111}’
I tried putting a wildcard in the example, but that didn’t allow the time to be flexible. I still received a 404:
In my contrived example, I’d like to be able to submit requests that always have “other: 1111”, but have variable times. Is this possible?
There are definitely more demonstrations and documentation of the Postman Mock Servers that are needed as even I feel like I’m learning something new each time
We’ll get there eventually and if it’s still not working, I’ll reach out to other members of the team.