Bird
0
0

In an interactive API explorer, you send a POST request with invalid JSON body. What is the most likely response?

medium📝 Predict Output Q5 of 15
Rest API - API Documentation
In an interactive API explorer, you send a POST request with invalid JSON body. What is the most likely response?
A403 Forbidden
B201 Created
C400 Bad Request
D204 No Content
Step-by-Step Solution
Solution:
  1. Step 1: Identify response to invalid JSON in POST

    Invalid JSON means the server cannot process the request, so it returns 400 Bad Request.
  2. Step 2: Eliminate other status codes

    201 means success creation, 403 means permission denied, 204 means success with no content; none fit invalid input.
  3. Final Answer:

    400 Bad Request -> Option C
  4. Quick Check:

    Invalid JSON = 400 Bad Request [OK]
Quick Trick: Bad JSON triggers 400 error from server [OK]
Common Mistakes:
MISTAKES
  • Thinking 201 means success despite invalid input
  • Confusing 403 with input errors
  • Assuming 204 means error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes