0

I know if i have node installed i can spin up JSON mock server in no time and then i can create endpoints which support GET,PUT,POST etc. Also i realise that data can be stored (like insertion deletion, updation etc) in db.json until json server is restarted.

Now i tried POSTMAN, and i realised it's very easy and simple process to setup mockserver and create an endpoint. But is there anyway i can do PUT, POST etc to postman and save the data somewhere? like we can do in JSON server's db.json?

also is there any other advantage i can get using POSTMAN's mock server over JSON mock server?

I am new to POSTMAN's mock server so any input would be of great help

user3921104
  • 154
  • 13

1 Answers1

0

Postman Mockserver:

The response you get from the mock server is the example you store for your request.

enter image description here

you can hardcode the value or store the response in a variable and set example as :

enter image description here

Now the response you get depends on the value for the variable 'response'

make sure you select the environment for the mock server where the variable 'response' is present

enter image description here

PDHide
  • 18,113
  • 2
  • 31
  • 46
  • sorry mate but am not sure what part of the question you are addressing ? – user3921104 Feb 11 '21 at 09:01
  • @user you wanted to store the json data, in postman you can do it as postman variable – PDHide Feb 11 '21 at 09:15
  • Postman mock server behave the same way as your example, so you can set post , get etc in your example – PDHide Feb 11 '21 at 09:18
  • thanks for your answer...is there a detailed explanation of the same somewhere which you can refer to please? Or if you can add step by step approach(the whole flow) after i create the mockserver in postman...I am kind of struggling to set this up..i know it's little bit of a ask but would be of great help if you can tell me the complete steps – user3921104 Feb 12 '21 at 01:13
  • i again kind of went through your answer, do you mean i set up an example response for "POST" and hardcode the response? If that is what you are saying it is still not dynamic adding to the response variable right? In JSON mock server you can actually add and update db.json dynamically ...or am i missing something in your answer? – user3921104 Feb 12 '21 at 01:17