Which of the following correctly formats the Authorization header to send a Bearer token in an HTTP request?
easy📝 Syntax Q3 of 15
Rest API - Authentication and Authorization
Which of the following correctly formats the Authorization header to send a Bearer token in an HTTP request?
AAuthorization: Bearer=abcdef123456
BAuthorization: Token abcdef123456
CAuthorization: BearerToken abcdef123456
DAuthorization: Bearer abcdef123456
Step-by-Step Solution
Solution:
Step 1: Understand the Bearer token format
The Authorization header must start with the word 'Bearer' followed by a space and then the token.
Step 2: Analyze each option
Authorization: Bearer abcdef123456 correctly uses 'Bearer' followed by a space and the token. Options B, C, and D use incorrect keywords or formatting.
Final Answer:
Authorization: Bearer abcdef123456 -> Option D
Quick Check:
Check for exact 'Bearer ' prefix and space before token [OK]
Quick Trick:Use 'Bearer ' followed by token with a space [OK]
Common Mistakes:
Omitting the space after 'Bearer'
Using 'Token' instead of 'Bearer'
Concatenating 'Bearer' and token without space
Master "Authentication and Authorization" in Rest API
9 interactive learning modes - each teaches the same concept differently