Get the Response in Mock Server

Here we will discuss how to get the response in other different formats in Postman, which is very easy. The most common format is JSON. Let's see how to get the response in JSON format.

  • From the top left corner in the Header section of the Postman app, select the New
Get the Response in Mock Server
  • Select the Mock Server.
Get the Response in Mock Server
  • Once you select the Mock server, a new panel will be opened. Through this panel, we can create a new request.
Get the Response in Mock Server
  • In the Response Body column, instead of writing plain text, enter the response body in JSON format.

Here, we will write the data about different Employees:

Copy the above JSON in the Response body.

Get the Response in Mock Server
  • Press Next. Now in the next panel, give the name of the server as per your choice. I gave 'JSON Response'.
Get the Response in Mock Server
  • Select on Create Mock Server button.
Get the Response in Mock Server
  • Select the Employee API and then select the JSON Response environment.
Get the Response in Mock Server
  • Press send and see the response.
Get the Response in Mock Server

Here, you might get the response in HTML format by default, change the format to JSON from the dropdown, and you will get the response as given above.

Similarly, we can use different formats to get the response in a mock server.






Latest Courses