Bird
0
0

What will be the output of this REST API call?

medium📝 Predict Output Q13 of 15
Rest API - REST API Fundamentals
What will be the output of this REST API call?
GET /users/123

Assuming user 123 exists and the API returns JSON data.
A500 Internal Server Error
B{"id":123,"name":"Alice"}
C404 Not Found
D{"error":"User not found"}
Step-by-Step Solution
Solution:
  1. Step 1: Understand the GET request to /users/123

    This request asks the server for data about user with ID 123.
  2. Step 2: Check the condition given

    The user 123 exists, so the server returns the user's data in JSON format.
  3. Final Answer:

    {"id":123,"name":"Alice"} -> Option B
  4. Quick Check:

    Existing user GET returns data = C [OK]
Quick Trick: GET existing user returns JSON data, not error [OK]
Common Mistakes:
  • Choosing error responses when user exists
  • Confusing 404 with successful data return
  • Not recognizing JSON format

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes