Questions tagged [postman-mocks]
31 questions
4
votes
2 answers
How do I configure my Postman mock server response to return a date always two days in the past?
In my Postman Mock Server, I have set up a GET request to return JSON, in which the following is returned
“due_date":"2021-10-10"
What I would like is to adjust the response so that the date is returned is two days in the past. So if today is…

Dave
- 15,639
- 133
- 442
- 830
4
votes
1 answer
Postman mock example response json data to include pathParms or queryParms or put body json object
I am using Postman 7.34.0
Now i am testing to use Postman to create mock server and mock data for the request.
After some study, i still did not get to make a flexible response in the mock data.
I have the update api and i will set pathParams,…

rodent_la
- 1,195
- 4
- 18
- 38
4
votes
1 answer
Unable to match a simple Soap body with 'x-mock-match-request-body' in Postman
Description
Unable to match a simple Soap body with x-mock-match-request-body.
To Reproduce
Steps to reproduce the behavior:
Create an example for a mock server with any url, any http verb and any response
e.g. POST {{url}}/test with the…

Haukland
- 677
- 8
- 25
4
votes
1 answer
Postman GET Response binary
I am setting up a mock server and would like to have a GET Response containing an image file, I cannot find any information on how to set this up.
The response section of Postman only has - Pretty/Raw/Preview options and no - from-data/binary?
Any…

Kris
- 322
- 8
- 19
3
votes
0 answers
Using Postman from Android Studio
I have recently learnt about Postman and it's ability to create and store GET responses from different URLs. I am trying to use this for testing an android app. Specifically I would like to:
Save some collections to my account via the Postman…

mars8
- 770
- 1
- 11
- 25
3
votes
1 answer
How to validate nested properties in component schema (openapi 3 in Postman)
I'm working on an OpenAPI 3 schema.
I would like to use a data model from the components.schemas inside the responses content and have some required nested properties inside that data model. However, it doesn't seem like the required validation is…

Denitsa
- 141
- 9
2
votes
0 answers
Is there a way to use the request query parameter value in the response
I am trying to create a Mock API server using Postman. My request will have a query parameter key. I want to use the value passed to the key query parameter in the mock response.
Request: {{url}}/foo?key=3
Response:
{
"3": {
...
}
}
I…

cyberpirate92
- 3,076
- 4
- 28
- 46
2
votes
1 answer
How to randomize ENUM-inputs in Postman?
In Postman I send the POST-request with JSON-body. The field status has 9 predefined ENUM values: Opened, Reserved, Paid, Shipped, Delivered, Returned, PartlyReturned, Closed, Canceled. How can I randomize the value of this field while sending the…

AlexF
- 387
- 1
- 4
- 20
2
votes
0 answers
Postman Mock Server matching algorithm logic for request body param form-data
Is there any option to send mock results depends on form data body value in postman?
I am sending some value in the body as form data and I have two example result and now the mock API return only one example I need to get the result based on the…

Midhilaj
- 4,905
- 9
- 45
- 88
2
votes
0 answers
How to save a response as example with Postman API
I'm using postman MockServer feature.
I have 2 collections in Postman. One for my real server, and the other for the mock.
Postman MockServer need examples to mock a response when you make a request call.
I need to automate the creation of new…

Nicolas Vergoz
- 169
- 1
- 10
2
votes
1 answer
Postman Mock with Path Variables
So I have successfully setup a postman mock server and can leverage the simple GETs that do not have any path variables in the api url but ALL the GETs that are something like {{url}}/users/:urserId or something like {{url}}/users/:userId/favorits…

workabyte
- 3,496
- 2
- 27
- 35
1
vote
1 answer
Is the mock url generated for postman mock server always https?
I have a .Net Web Api(http://someIP:port/path) to handle HTTP POST request. I want to create mock server in postman. I followed this page, then I got a mock url like this:
https://511d28ba-e0aa-438e-b226-a2a77dbf0d1b.mock.pstmn.io
I'm new to…

Walker66
- 103
- 10
1
vote
1 answer
How can I print the assertion with a value even if it get passed in Postman Api Testing
As a user, while executing the test cases created for the API Request, I'm expecting that it must show the value of the assertion even if the test cases pass.
For Example:
pm.test("User ID Should Exist", ()=>{
value =…

Muhammad Uzair
- 30
- 2
1
vote
0 answers
How can I make a Postman mock server return different examples?
In Postman, I wish to create a mock server that contains a request with 3 different examples of a response, each one associated to a HTTP code, so that on three successive calls, that request returns the mock responses in the given order.…

Elg
- 31
- 5
1
vote
3 answers
How to return dynamic response from postman mock server?
I want to return the dynamic response from the postman mock server.
When mock URL hits in the postman, we get request body and from request body I want to fetch the field value and return the value to response.
mock URL :…

Swarnim Kumar
- 335
- 5
- 21