Bird
0
0

You want to create a new blog post resource with title and content using a POST request. Which of these JSON payloads correctly represents the data to send in the request body?

hard📝 Application Q15 of 15
Rest API - HTTP Methods
You want to create a new blog post resource with title and content using a POST request. Which of these JSON payloads correctly represents the data to send in the request body?
A["title", "My Day", "content", "It was sunny."]
B"title=My Day&content=It was sunny."
C{"My Day": "title", "It was sunny.": "content"}
D{"title": "My Day", "content": "It was sunny."}
Step-by-Step Solution
Solution:
  1. Step 1: Understand JSON object structure

    JSON objects use key-value pairs with keys as strings and values as data.
  2. Step 2: Identify correct JSON format

    {"title": "My Day", "content": "It was sunny."} correctly uses keys "title" and "content" with their string values in an object.
  3. Final Answer:

    {"title": "My Day", "content": "It was sunny."} -> Option D
  4. Quick Check:

    JSON object with keys and values = {"title": "My Day", "content": "It was sunny."} [OK]
Quick Trick: JSON data must be key-value pairs inside braces {} [OK]
Common Mistakes:
  • Using JSON arrays instead of objects
  • Swapping keys and values
  • Sending URL-encoded string instead of JSON

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes