0
0
Postmantesting~10 mins

Pretty, raw, and preview views in Postman - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select the view that formats JSON responses nicely in Postman.

Postman
responseBody.view = '[1]';
Drag options to blanks, or click blank then click option'
Apretty
Braw
Cpreview
Dcompact
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'raw' which shows unformatted text.
Selecting 'preview' which renders HTML content.
2fill in blank
medium

Complete the code to select the view that shows the exact response text without formatting.

Postman
responseBody.view = '[1]';
Drag options to blanks, or click blank then click option'
Araw
Bpreview
Cpretty
Dformatted
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'pretty' which formats the response.
Selecting 'preview' which renders HTML content.
3fill in blank
hard

Fix the error in the code to select the view that renders HTML content in Postman.

Postman
responseBody.view = '[1]';
Drag options to blanks, or click blank then click option'
Apretty
Bpreview
Craw
Dhtml
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'raw' which shows unformatted text.
Using 'pretty' which formats JSON but does not render HTML.
4fill in blank
hard

Fill both blanks to set the response view to pretty and check if the content type is JSON.

Postman
if (response.headers['Content-Type'] [1] 'application/json') {
  responseBody.view = '[2]';
}
Drag options to blanks, or click blank then click option'
A===
B!==
Cpretty
Draw
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!==', which means not equal.
Setting view to 'raw' which does not format JSON.
5fill in blank
hard

Fill all three blanks to set the response view based on content type: pretty for JSON, preview for HTML, raw otherwise.

Postman
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';
}
Drag options to blanks, or click blank then click option'
A===
B!==
Cpretty
Draw
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!==', which means not equal.
Setting wrong views for content types.