Bird
0
0

Given the URL /customers/789, which HTTP method should be used to delete this customer without verbs in the URL?

medium📝 Predict Output Q5 of 15
Rest API - URL and Resource Design
Given the URL /customers/789, which HTTP method should be used to delete this customer without verbs in the URL?
ADELETE
BPOST
CPUT
DGET
Step-by-Step Solution
Solution:
  1. Step 1: Understand HTTP methods for deletion

    DELETE method is used to remove a resource.
  2. Step 2: Match method with URL

    The URL '/customers/789' identifies the resource. Using DELETE with this URL removes the customer without needing verbs in the URL.
  3. Final Answer:

    DELETE -> Option A
  4. Quick Check:

    DELETE method deletes resource at URL [OK]
Quick Trick: Use DELETE method to remove resource, keep URL noun-only [OK]
Common Mistakes:
MISTAKES
  • Using POST or PUT to delete
  • Adding verbs in URL for deletion
  • Using GET for delete action

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes