Bird
0
0

Look at this example request and response pair:

medium📝 Debug Q14 of 15
Rest API - API Documentation

Look at this example request and response pair:

Request: POST /api/login HTTP/1.1\nHost: example.com\nContent-Type: application/json\n\n{"username": "user", "password": "pass"}
Response: 404 Not Found

What is the most likely error in the example?

AThe URL path is incorrect or missing
BThe HTTP method POST is invalid
CThe Content-Type header is wrong
DThe JSON body is malformed
Step-by-Step Solution
Solution:
  1. Step 1: Understand 404 Not Found meaning

    404 means the server did not find the requested URL path.
  2. Step 2: Check the request details

    POST and Content-Type look correct; JSON body is valid. So the path is likely wrong or missing.
  3. Final Answer:

    The URL path is incorrect or missing -> Option A
  4. Quick Check:

    404 error = wrong URL path [OK]
Quick Trick: 404 means URL path not found, check request URL [OK]
Common Mistakes:
MISTAKES
  • Thinking 404 means bad JSON or headers
  • Assuming POST method is invalid
  • Ignoring the URL path correctness

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes