← Quiz: Postman: all 10 questions
Quiz: Postman · Question 8 of 10
Which line in a Postman test checks that the response JSON contains the course title "Java Full Stack"?
Which line in a Postman test checks that the response JSON contains the course title "Java Full Stack"?
- A.pm.response.to.have.status(200)
- B.pm.expect(pm.response.json().map(c => c.title)).to.include('Java Full Stack')
- C.pm.environment.set('title', 'Java Full Stack')
- D.pm.sendRequest('Java Full Stack')
Answer & explanation
Correct answer: pm.expect(pm.response.json().map(c => c.title)).to.include('Java Full Stack')
pm.response.json() parses the body; pm.expect makes the assertion.
Can you get the rest right without peeking?
Take the timed Quiz: Postman quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →