Bird
0
0

Given this Accept header:

medium📝 Predict Output Q4 of 15
Rest API - Request and Response Format
Given this Accept header:
Accept: application/json, text/html;q=0.5
What content type will the server most likely respond with?
Aapplication/json
Btext/html
Capplication/xml
Dtext/plain
Step-by-Step Solution
Solution:
  1. Step 1: Analyze Accept header priorities

    application/json has no quality factor, so defaults to 1.0; text/html has q=0.5.
  2. Step 2: Determine server response format

    Server picks highest priority format supported, here application/json.
  3. Final Answer:

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

    Highest q value wins = application/json [OK]
Quick Trick: Highest q value in Accept header determines response format [OK]
Common Mistakes:
  • Ignoring quality factors and picking lower priority
  • Assuming server always picks text/html
  • Confusing Accept with Content-Type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes