Bird
0
0

Consider this REST API response snippet:

medium📝 Predict Output Q13 of 15
Rest API - HTTP Status Codes

Consider this REST API response snippet:

{
  "error": "Invalid JSON format",
  "status": 400
}

What does this response tell the client?

AThe client sent a request with invalid JSON data.
BThe server successfully processed the request.
CThe requested resource was not found.
DThe server is down and cannot respond.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the error message and status code

    The error says "Invalid JSON format" and status is 400, indicating a bad request.
  2. Step 2: Interpret the meaning for the client

    The client sent JSON data that the server could not parse, so the request is invalid.
  3. Final Answer:

    The client sent a request with invalid JSON data. -> Option A
  4. Quick Check:

    400 + invalid JSON = client sent bad data [OK]
Quick Trick: Error message + 400 means client sent bad data [OK]
Common Mistakes:
  • Thinking 400 means server error
  • Assuming resource not found
  • Ignoring the error message details

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes