Bird
0
0

You see this endpoint documentation snippet:

medium📝 Debug Q14 of 15
Rest API - API Documentation
You see this endpoint documentation snippet:
{
  "endpoint": "/items",
  "method": "POST",
  "parameters": {
    "name": "string",
    "quantity": "integer"
  },
  "response": {
    "201": "Item created"
  }
}
But the API returns a 400 error when you send the request. What is the most likely mistake in the documentation?
AThe endpoint URL is missing a trailing slash
BThe HTTP method should be GET, not POST
CParameters should be inside a "requestBody" section, not "parameters"
DThe response code 201 is incorrect for creation
Step-by-Step Solution
Solution:
  1. Step 1: Understand POST request structure

    POST requests usually send data in the request body, not as URL parameters.
  2. Step 2: Check documentation structure

    Parameters listed under "parameters" implies URL/query parameters; for POST data, it should be under "requestBody".
  3. Final Answer:

    Parameters should be inside a "requestBody" section, not "parameters" -> Option C
  4. Quick Check:

    POST data = requestBody, not parameters [OK]
Quick Trick: POST data goes in requestBody, not parameters [OK]
Common Mistakes:
MISTAKES
  • Confusing query parameters with request body
  • Changing HTTP method incorrectly
  • Ignoring correct response codes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes