Bird
0
0

Identify the error in this GET request example: GET /users/ with body {"id": 10}

medium📝 Debug Q14 of 15
Rest API - HTTP Methods
Identify the error in this GET request example: GET /users/ with body {"id": 10}
AThe URL is missing the user ID
BGET requests should not have a body
CThe HTTP method should be POST
DThe JSON body is missing a field
Step-by-Step Solution
Solution:
  1. Step 1: Understand GET request rules

    GET requests do not send a body; they pass parameters via URL path or query string.
  2. Step 2: Check the given request

    The request has a JSON body, which is invalid for GET and ignored by most servers.
  3. Final Answer:

    GET requests should not have a body -> Option B
  4. Quick Check:

    GET = no body allowed [OK]
Quick Trick: GET requests never include a body [OK]
Common Mistakes:
MISTAKES
  • Adding body data to GET requests
  • Confusing GET with POST or PUT
  • Assuming URL must always include ID

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes