Bird
0
0

Identify the error in this HTTP request if the goal is to safely retrieve data:

medium📝 Debug Q14 of 15
Rest API - HTTP Methods
Identify the error in this HTTP request if the goal is to safely retrieve data:
POST /users HTTP/1.1
Host: example.com
AThe HTTP version is incorrect; it should be HTTP/2.0.
BThe Host header is missing, causing a syntax error.
CPOST is unsafe and changes data; GET should be used to retrieve data.
DPOST cannot be used with /users endpoint.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the goal and method used

    The goal is to safely retrieve data, but POST is used which changes data.
  2. Step 2: Identify correct method for safe retrieval

    GET is the safe method to retrieve data without side effects.
  3. Final Answer:

    POST is unsafe and changes data; GET should be used to retrieve data. -> Option C
  4. Quick Check:

    Safe retrieval = GET, not POST [OK]
Quick Trick: Use GET to retrieve data safely, not POST [OK]
Common Mistakes:
MISTAKES
  • Ignoring method safety
  • Thinking Host header is missing
  • Confusing HTTP versions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes