Nice I'm in the situation where our backend & frontend devs are developing in parallel. Last sprint I was manually writing mock functions in the frontend based on the openapi yaml, but I think this can save a lot of time. Thanks for the video I'm gonna try it out.
Před 2 lety+1
Wow that's awesome feature that I did not realize until today. I'll use it a lot from now on 100%! Thanks for this great product!
This video was super helpful! Thank you so much. Now, is it also possible to add a POST, PUT or PATCH request and the data in the body would be saved to the mock server and could then be in the response when the later a GET request is made?
Examples inform your mock server. An example is a paired request and response. So you can update the HTTP method and request or response body to save as an example. learning.postman.com/docs/designing-and-developing-your-api/mocking-data/mocking-with-examples/
but there's no way to make that happen automatically when the server receives POST, PUT, or PATCH requests, right? For example: when GET /todos returns [], and then a POST /todo {"text": "todo1"} happens, GET /todos should start returning [{"id": 1, "text": "todo1"}] I saw that it's possible with Tests, but is it possible when the mock server is used for client-side development?
I want to copy some field from the request to the mock response every time my mock service is hit. For instance, trackingID from request payload should be sent back as part of mock response. How can we do that?
Mock server responses can be randomly generated but they can't send back a specific thing. If you're looking to echo back requests you may want to use the Postman Echo API: postman-echo.com/
Please, add a programmable way of making mock responses on mocking servers. I need a simple proxy functionality that accepts a request and redirects it to another server. I can't do it in current implementation.
You can use the Postman API to do that. Here are a bunch of examples: medium.com/better-practices/https-medium-com-postman-engineering-fake-it-till-you-make-it-mocks-for-agile-development-f4d050cad694
You'll be limited to 1000 mock calls/month on the free plan but it should be more than enough to get started! More info on our pricing page: www.postman.com/pricing/
I followed the exact steps and got the following error message { "error": { "name": "invalidCredentialsError", "header": "Unable to authenticate", "message": "Double check your API key and try again." } }
If you choose to make your mock server private, you will need to add a Postman API key in the request header: learning.postman.com/docs/designing-and-developing-your-api/mocking-data/setting-up-mock/#configuring-mock-details
Mock POST requests will work in a pretty similar way. You can find more info on the matching algorithm on the Learning Center: learning.postman.com/docs/designing-and-developing-your-api/mocking-data/matching-algorithm/
This should be created when you set the example response body (see at 1:55). If you're still having an issue please ask your question on the community forum: community.postman.com
Nice I'm in the situation where our backend & frontend devs are developing in parallel. Last sprint I was manually writing mock functions in the frontend based on the openapi yaml, but I think this can save a lot of time. Thanks for the video I'm gonna try it out.
Wow that's awesome feature that I did not realize until today. I'll use it a lot from now on 100%! Thanks for this great product!
This is exactly that I was looking for \ o /
Very well Explained the concepts
straight to the point
we can also use Faux API platform, which gives us a lot of space to store values in APis and access it anytime we want, without any limits
Thank You SO MUCH for this awsome tutorial!!!
awesome
thanks a lot for your video!
Great video
Nice tutorial - Thank you and very helpful!
Thx very much
It was helpfull, tnx!
Great thank you
This video was super helpful! Thank you so much. Now, is it also possible to add a POST, PUT or PATCH request and the data in the body would be saved to the mock server and could then be in the response when the later a GET request is made?
Examples inform your mock server. An example is a paired request and response. So you can update the HTTP method and request or response body to save as an example. learning.postman.com/docs/designing-and-developing-your-api/mocking-data/mocking-with-examples/
but there's no way to make that happen automatically when the server receives POST, PUT, or PATCH requests, right?
For example:
when GET /todos returns [],
and then a POST /todo {"text": "todo1"} happens,
GET /todos should start returning [{"id": 1, "text": "todo1"}]
I saw that it's possible with Tests, but is it possible when the mock server is used for client-side development?
I want to copy some field from the request to the mock response every time my mock service is hit. For instance, trackingID from request payload should be sent back as part of mock response. How can we do that?
Mock server responses can be randomly generated but they can't send back a specific thing. If you're looking to echo back requests you may want to use the Postman Echo API: postman-echo.com/
When I click "New" none of the options in the video are present. There is no "mock server" option
I'm going to create a mock called "flags" ;-)
Please, add a programmable way of making mock responses on mocking servers. I need a simple proxy functionality that accepts a request and redirects it to another server. I can't do it in current implementation.
You can use the Postman API to do that. Here are a bunch of examples: medium.com/better-practices/https-medium-com-postman-engineering-fake-it-till-you-make-it-mocks-for-agile-development-f4d050cad694
Hi. Have any limitation, using free version of Postman? Ty
You'll be limited to 1000 mock calls/month on the free plan but it should be more than enough to get started! More info on our pricing page: www.postman.com/pricing/
@@postman ty
I followed the exact steps and got the following error message
{
"error": {
"name": "invalidCredentialsError",
"header": "Unable to authenticate",
"message": "Double check your API key and try again."
}
}
If you choose to make your mock server private, you will need to add a Postman API key in the request header: learning.postman.com/docs/designing-and-developing-your-api/mocking-data/setting-up-mock/#configuring-mock-details
@@postman thanks for a quick reply! I will try again with the public setting
Hm, why do not introduce POST example? :(
Mock POST requests will work in a pretty similar way. You can find more info on the matching algorithm on the Learning Center: learning.postman.com/docs/designing-and-developing-your-api/mocking-data/matching-algorithm/
I don't find the the default option that you have @3:59
This should be created when you set the example response body (see at 1:55). If you're still having an issue please ask your question on the community forum: community.postman.com
@@postman thanks, my issue resolved