Reputation: 131
I created a mock server using Postman, then I accessed the server url, I got HTML response body. However, I want JSON response body.
What do I have to do?
Upvotes: 5
Views: 4285
Reputation: 25921
To get the correctly formatted response, you need to include the Content-Type
header in the response section of the Example
.
This is what the Mock Server response looks like without the header:
Open the Example
and add the header to the bottom response section, you may see the Body
tab shown when you open the Example
, switch tabs to Headers
, add the header and save the Example
.
With the header added, send the request to the Mock Server, this will return the correctly formatted response based on the Content-Type
header.
Upvotes: 9