waynejohn1110
waynejohn1110

Reputation: 111

How do I create a mock server backend API with Postman?

I'm not understanding this tutorial.

I have a collection set up in Postman, I created a GET request in the collection and an example.

I'm not sure what to put in the request URL for the mock API example and what values to put in key/value in the request call.

Upvotes: 1

Views: 1759

Answers (1)

Danny Dainton
Danny Dainton

Reputation: 25881

Following the examples from the Postman documentation you mentioned - At Step 5 you should have a mock for the collection:

enter image description here

I've saved a simple GET request http://jsonplaceholder.typicode.com/users to the collection using the free jsonplaceholder API which will return details about users.

enter image description here

Once you have that response, hit the "Save Response" button and this will save that response as an example that can use with the mock server.

You can make requests against the mock server URL and add your route to the end of this in the Request Field. For me, it would look something like https://914aae16-28d5-47f1-8954-8a4d7b5e1daf.mock.pstmn.io/users

enter image description here

Upvotes: 1

Related Questions