Bird
0
0

Given this HTTP request header:

medium📝 Predict Output Q13 of 15
Rest API - Request and Response Format
Given this HTTP request header:
Accept: application/xml, application/json;q=0.8
Which content type will the server most likely respond with?
Aapplication/xml
Bapplication/pdf
Ctext/html
Dapplication/json
Step-by-Step Solution
Solution:
  1. Step 1: Understand quality values (q) in Accept header

    The q value shows preference; higher q means higher priority.
  2. Step 2: Compare q values for application/xml and application/json

    application/xml has no q value, so defaults to 1. application/json has q=0.8, lower priority.
  3. Final Answer:

    application/xml -> Option A
  4. Quick Check:

    Higher q or default 1 wins = application/xml [OK]
Quick Trick: No q means 1.0, highest priority wins [OK]
Common Mistakes:
MISTAKES
  • Ignoring q values and picking lower priority
  • Choosing JSON because it appears second
  • Selecting unrelated content types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes