I have a Postman mock that are called by my C# application, the problem is that I don’t know how the request really looks like so I can´t add an example to postman collection for the Mock. Is there a way to copy incoming request as example for the mock collection to avoid the “no matching response”? I already got help to ignore the request matching but it would be nice if I could make it work without adding special header("x-mock-response-id) in my c# app.
Yes, but i’m not sure how to copy\paste it to a proper request message? I suppose it will have to perfect match. So how do the raw request look like in this example :
So I select my collection and click the Tests tab, in here I add
console.log(JSON.stringify(pm.request));
What do i do then? I have tried to send requests to the Postman Mock and I have tried to “run a test” under Collection > Runs
The Collection have a Post request that is empty at this point, here is also a test tab but it seems to be bound to the GET/POST request. On this case I need to listen to incoming request from my client and then take this request and add it to expected request in the collection. This to avoid having to point out a the specific response that my client expects.
My apologies I misread your original post and was multitasking when I replied.
The console.log would work if running from Postman.
If the webhook is triggered from elsewhere I will have to have a think, as Im not sure on the solution (or if there is a solution).
I have created a collection that I created a Postman Mock service from. My .NET client can send messages to the Postman Mock Service but there is no request to match it with so it fails. To solve this I had to add a header on the .NET client that points out the response from postman it expects. This works fine but it would be great if I did not have to have special code in my .NET client to make test calls to postman mock service.
What I need is to get the request as it looks like in the wire, paste it in i postman so it can be matched with the client request so that the proper response can be returned without special header.
From what I understand the Postman Interceptor is a Chrome extension, my project do not use any browser at all? It uses .net HttpClient to send a message to a mock service.