Rest API - Request and Response FormatWhich of the following is the correct JSON structure for sending a user's name and age in the request body?A{"name": "John", age: 25}B{"name": John, "age": 25}C{"name": "John", "age": 25}D{name: "John", "age": 25}Check Answer
Step-by-Step SolutionSolution:Step 1: Check JSON syntax rulesKeys and string values must be in double quotes. Numbers do not need quotes.Step 2: Validate each option{"name": "John", "age": 25} correctly quotes keys and string values. Options A, B, and D miss quotes around keys or string values.Final Answer:{"name": "John", "age": 25} -> Option CQuick Check:JSON keys and strings need double quotes [OK]Quick Trick: Always quote keys and string values in JSON [OK]Common Mistakes:MISTAKESMissing quotes around keys or stringsUsing single quotes instead of double quotesQuoting numbers unnecessarily
Master "Request and Response Format" in Rest API9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Rest API Quizzes HTTP Methods - PUT for full replacement - Quiz 5medium HTTP Status Codes - 301 and 302 redirects - Quiz 2easy HTTP Status Codes - 500 Internal Server Error - Quiz 9hard REST API Fundamentals - Statelessness requirement - Quiz 3easy REST API Fundamentals - REST constraints and principles - Quiz 8hard Request and Response Format - Response headers (Cache-Control, ETag) - Quiz 14medium Request and Response Format - Why consistent formats improve usability - Quiz 1easy Request and Response Format - Error response format - Quiz 2easy URL and Resource Design - Avoiding verbs in URLs - Quiz 14medium URL and Resource Design - Query parameters for filtering - Quiz 10hard