🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A..header("token", token) always
  2. B..auth().oauth2(token)
  3. C..body(token)
  4. 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 →