Rest API - Request and Response FormatWhy does JSON not allow comments inside its data format?ATo prevent security vulnerabilitiesBBecause comments are not useful in dataCBecause JSON is only for numbers and stringsDTo keep the format simple and avoid parsing errorsCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand JSON design goalsJSON aims to be a simple, lightweight data format easy to parse.Step 2: Reason about comments in dataAllowing comments complicates parsing and can cause errors, so they are disallowed.Final Answer:To keep the format simple and avoid parsing errors -> Option DQuick Check:No comments in JSON to keep parsing simple [OK]Quick Trick: JSON disallows comments to keep parsing simple [OK]Common Mistakes:Thinking comments are useless in dataBelieving JSON only supports numbers and stringsAssuming comments cause security issues
Master "Request and Response Format" in Rest API9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Rest API Quizzes HTTP Methods - Why HTTP methods define intent - Quiz 4medium HTTP Methods - Safe methods vs unsafe methods - Quiz 6medium HTTP Status Codes - 500 Internal Server Error - Quiz 10hard REST API Fundamentals - Client-server architecture - Quiz 9hard REST API Fundamentals - REST vs SOAP vs GraphQL comparison - Quiz 11easy REST API Fundamentals - Client-server architecture - Quiz 13medium REST API Fundamentals - REST vs SOAP vs GraphQL comparison - Quiz 15hard Request and Response Format - Response envelope patterns - Quiz 6medium URL and Resource Design - Query parameters for filtering - Quiz 2easy URL and Resource Design - Avoiding verbs in URLs - Quiz 10hard