← Quiz: REST Assured: all 10 questions
Quiz: REST Assured · Question 9 of 10
How do you send a token as a Bearer header in REST Assured?
How do you send a token as a Bearer header in REST Assured?
- A..header("token", token) always
- B..auth().oauth2(token)
- C..body(token)
- D..queryParam("Bearer", token)
Answer & explanation
Correct answer: .auth().oauth2(token)
It adds Authorization: Bearer <token> to the request.
Can you get the rest right without peeking?
Take the timed Quiz: REST Assured quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →