Bird
0
0

Which of the following is the correct REST API endpoint syntax to retrieve all comments?

easy📝 Syntax Q3 of 15
Rest API - URL and Resource Design
Which of the following is the correct REST API endpoint syntax to retrieve all comments?
AGET /comments
BGET /comment
CGET /comments/{id}
DGET /comment/list
Step-by-Step Solution
Solution:
  1. Step 1: Identify endpoint for collection retrieval

    Retrieving all items in a collection uses the plural resource name without an ID.
  2. Step 2: Choose plural resource without extra path

    GET /comments correctly retrieves all comments.
  3. Final Answer:

    GET /comments -> Option A
  4. Quick Check:

    Retrieve all comments = B [OK]
Quick Trick: Use plural resource name without ID to get all items [OK]
Common Mistakes:
MISTAKES
  • Using singular resource for collection
  • Adding unnecessary /list suffix
  • Including ID when retrieving all items

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes