Bird
Raised Fist0

Given this Problem Details JSON response:

medium📝 Predict Output Q13 of Q15
Rest API - Error Handling
Given this Problem Details JSON response:
{"type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit.", "status": 403, "detail": "Your current balance is 30, but that costs 50.", "instance": "/account/12345/msgs/abc"}

What is the HTTP status code indicated?
A403
B404
C200
D500
Step-by-Step Solution
Solution:
  1. Step 1: Locate the status field in JSON

    The JSON has "status": 403, which indicates the HTTP status code.
  2. Step 2: Understand the meaning of 403

    403 means Forbidden, matching the error about insufficient credit.
  3. Final Answer:

    403 -> Option A
  4. Quick Check:

    Status code = 403 [OK]
Quick Trick: Look for 'status' field for HTTP code [OK]
Common Mistakes:
MISTAKES
  • Confusing status with 'detail' content
  • Picking 200 as success code
  • Ignoring the numeric status field

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes