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.82k stars 837 forks source link

Update mocks to consider the rank the presence and absence of header parameters #8084

Open jwbanning opened 4 years ago

jwbanning commented 4 years ago

If you want to use an endpoint and use mocks to respond accordingly to header parameters using 'x-mock-match-request-headers', if you do not pass a header parameter and/or 'x-mock-match-request-headers' you can not have an example in the mock server that handles this.

The endpoints in the mock examples are all the same (i.e. {{url}}/someThing). It is just the header parameters that differ. Watch the video below for more context.

Describe the solution you'd like Support the ability to not pass an 'x-mock-match-request-headers' that matches an example in the mock.

Additional context See the discussion here: https://github.com/postmanlabs/postman-app-support/issues/8065

Video: https://drive.google.com/file/d/1GgppFq_rFef_xy6nh0X_oUibDIM1JvTq/view

sony-mathew commented 4 weeks ago

Hey @jwbanning

I hope you're doing well! I wanted to follow up on your issue with our mock server. We've made significant improvements to the feature over time, and I'm excited to share that we've introduced a new way to configure matching based on body or headers directly from the mock server configuration.

This means you can now easily add new headers for mocking without having to modify your development setup. I've attached a screenshot to help illustrate this new feature.

Screenshot 2024-09-02 at 1 39 21 AM

You can read about it in our learning center documentation here.

I hope this resolves the issue you're experiencing. If you have any questions or concerns, please don't hesitate to reach out. We're always here to help and want to make sure you're able to get the most out of our mock server.