Bird
0
0

You want to test an API endpoint that requires a custom header X-Auth-Token using an interactive API explorer. How do you add this header correctly?

hard📝 Application Q8 of 15
Rest API - API Documentation
You want to test an API endpoint that requires a custom header X-Auth-Token using an interactive API explorer. How do you add this header correctly?
AAppend the token as a query parameter named 'X-Auth-Token' in the URL
BAdd a new header field named 'X-Auth-Token' with the token value in the headers section
CInclude the token in the JSON body under 'X-Auth-Token'
DWrite the token inside the URL path after the endpoint
Step-by-Step Solution
Solution:
  1. Step 1: Understand how to add custom headers in API explorers

    Custom headers are added in the headers section, specifying name and value pairs.
  2. Step 2: Differentiate from other methods

    Adding token in body or URL is incorrect for headers; only Add a new header field named 'X-Auth-Token' with the token value in the headers section correctly adds a header.
  3. Final Answer:

    Add a new header field named 'X-Auth-Token' with the token value in the headers section -> Option B
  4. Quick Check:

    Custom header = Add in headers section [OK]
Quick Trick: Custom headers go in headers section, not body or URL [OK]
Common Mistakes:
MISTAKES
  • Putting headers inside JSON body
  • Using query parameters instead of headers
  • Appending tokens in URL path

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes