Complete the code to select the view that formats JSON responses nicely in Postman.
responseBody.view = '[1]';
The pretty view formats JSON responses with indentation and colors for easy reading.
Complete the code to select the view that shows the exact response text without formatting.
responseBody.view = '[1]';
The raw view shows the response exactly as received, without any formatting.
Fix the error in the code to select the view that renders HTML content in Postman.
responseBody.view = '[1]';
The preview view renders HTML content so you can see how it looks in a browser.
Fill both blanks to set the response view to pretty and check if the content type is JSON.
if (response.headers['Content-Type'] [1] 'application/json') { responseBody.view = '[2]'; }
The code checks if the content type is exactly 'application/json' using ===, then sets the view to pretty for formatted JSON.
Fill all three blanks to set the response view based on content type: pretty for JSON, preview for HTML, raw otherwise.
if (response.headers['Content-Type'] [1] 'application/json') { responseBody.view = '[2]'; } else if (response.headers['Content-Type'] [3] 'text/html') { responseBody.view = 'preview'; } else { responseBody.view = 'raw'; }
The code uses strict equality === to check content types. It sets pretty view for JSON, preview for HTML, and raw for others.