← Quiz: Postman: all 10 questions
Quiz: Postman · Question 1 of 10
Which line saves the login token for later requests in a Postman test script?
Which line saves the login token for later requests in a Postman test script?
- A.pm.test('token')
- B.pm.collectionVariables.set('token', pm.response.json().token)
- C.console.log(token)
- D.pm.response.to.have.token()
Answer & explanation
Correct answer: pm.collectionVariables.set('token', pm.response.json().token)
Later requests use it as {{token}}.
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 →