postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.84k stars 839 forks source link

Expose the raw body on the mock server call log #8334

Open mustela opened 4 years ago

mustela commented 4 years ago

When using the mock server, it would be super useful to have the log exposing the raw data, like the body, headers, and not wrapping them into the UI.

Screenshot 2020-04-15 at 10 52 16

Although it's a nice ui, it's hard to use when you are comparing different calls, and trying to understand why calls are not being matched, etc.

Thanks!

vvs11 commented 4 years ago

@mustela Thanks for the feedback. We will keep a note of this and work upon improving the experience

DanDepot commented 3 years ago

I am also in need of the mock server log showing the request and response body as raw text in the same way you can see the request and response body on a normal postman request as raw text.

Is there any status on this change?

vvs11 commented 3 years ago

@DanDepot @mustela Could you elaborate on your use-case here? Also, would it be possible to get on a call and understand more about how you use postman mocks. This would help us build better features in future.

pinko-fowle commented 3 years ago

@vvs11 We're trying to use some of the data we get from the mock endpoint in our code, but we can't effectively use the data we get on the mock server because the UI keeps us from being able to actually look at the real data. :(

ebrown5-captioncall commented 1 year ago

I have a similar situation - I've created calls with examples and tested them using Postman to get successful responses.

When I call from my app, I cannot get the example to be found (I get "no matching requests" in the log)

I've turned off header matching in the mock server configuration, so copying headers should not be the answer.

I copied and pasted the body from the "failed" request into the example and still have no matches.

I will be creating a related feature request: provide an affordance to create a request with examples from "no matching request" log entries. This would allow me to skip the process of debugging why my mocks are failing and move forward with testing my products.

Pulseweaver commented 1 year ago

I get "No matching requests" when making a call to the postman mock service. I suspect that there need to be a expected request registered in the mock but I don't really know how it looks like. So if postman could just let me see and copy the incoming request it would be easier to setup the mock service and avoid this warning.

ebrown5-captioncall commented 1 year ago

Yeah, it's a bit annoying to not have any idea what's causing the issue.

I made a copy of the "get mock server logs" example and use that to see the full details and it's helped.

Still, it'd be great to have the ability to make an example out of a failed request. Looking at the data structures, it's not super simple to do, but it's far from impossible. And I have no idea how to integrate that into the postman UI.

The specific issue I had when I first posted my suggestion was the app that was making the call was using lower-case for the "Content-Type" header. When I changed my example to match, it started working.


From: snowjim @.> Sent: Thursday, March 9, 2023 7:42 AM To: postmanlabs/postman-app-support @.> Cc: Earl Brown @.>; Comment @.> Subject: Re: [postmanlabs/postman-app-support] Expose the raw body on the mock server call log (#8334)

[EXTERNAL]

I get "No matching requests" when making a call to the postman mock service. I suspect that there need to be a expected request registered in the mock but I don't really know how it looks like. So if postman could just let me see and copy the incoming request it would be easier to setup the mock service and avoid this warning.

— Reply to this email directly, view it on GitHubhttps://github.com/postmanlabs/postman-app-support/issues/8334#issuecomment-1462178224, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOHPLACQOERLWXR6CCMWR53W3HT37ANCNFSM4MIMTEQA. You are receiving this because you commented.Message ID: @.***>