Bird
0
0

Consider this partial API response:

medium📝 Debug Q6 of 15
Rest API - HATEOAS and Linking
Consider this partial API response:
{"state": "draft", "actions": {"submit": "/docs/456/submit"}}

Which of the following is a likely error if the client tries to perform "submit" with a GET request?
A200 OK with no effect
B405 Method Not Allowed
C404 Not Found
D500 Internal Server Error
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct HTTP method for action

    State-changing actions like "submit" usually require POST, not GET.
  2. Step 2: Understand server response to wrong method

    Using GET on an endpoint expecting POST results in 405 Method Not Allowed.
  3. Final Answer:

    405 Method Not Allowed -> Option B
  4. Quick Check:

    Wrong HTTP method = 405 error [OK]
Quick Trick: Use correct HTTP method or get 405 error [OK]
Common Mistakes:
  • Expecting 404 instead of 405
  • Assuming 200 OK with no effect
  • Thinking server crashes with 500

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes