Bird
0
0

What is the correct HTTP method and URL to retrieve a list of books without verbs in the URL?

medium📝 Predict Output Q4 of 15
Rest API - URL and Resource Design
What is the correct HTTP method and URL to retrieve a list of books without verbs in the URL?
ADELETE /books/list
BPOST /getBooks
CGET /books
DGET /fetchBooks
Step-by-Step Solution
Solution:
  1. Step 1: Identify the action and resource

    Retrieving data uses the GET method, and the resource is 'books'.
  2. Step 2: Check URL for verbs

    GET /books uses GET and '/books' without verbs. DELETE /books/list uses the incorrect DELETE method for retrieval, while '/getBooks' and '/fetchBooks' include verbs in the URL.
  3. Final Answer:

    GET /books -> Option C
  4. Quick Check:

    GET + noun URL = GET /books [OK]
Quick Trick: Use GET with resource noun URL to retrieve data [OK]
Common Mistakes:
MISTAKES
  • Using POST or DELETE for retrieval
  • Including verbs in URL paths
  • Confusing HTTP method with URL action

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes