Bird
0
0

Identify the error in this JSON error response:

medium📝 Debug Q6 of 15
Rest API - Request and Response Format
Identify the error in this JSON error response:
{"error": {"code": 401, "message": Unauthorized}}
AMissing quotes around the message value
BMissing quotes around the code key
CIncorrect nesting of error object
DExtra comma after message
Step-by-Step Solution
Solution:
  1. Step 1: Check JSON string values

    String values must be in double quotes. "Unauthorized" is missing quotes.
  2. Step 2: Verify keys and structure

    Keys are correctly quoted and nesting is correct, no extra commas.
  3. Final Answer:

    Missing quotes around the message value -> Option A
  4. Quick Check:

    String values need quotes in JSON [OK]
Quick Trick: Always quote string values in JSON error messages [OK]
Common Mistakes:
  • Forgetting quotes around string values
  • Misplacing commas
  • Incorrect object nesting

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes