examerioLogin

What are the standard methods in a Django REST Framework ViewSet and their corresponding HTTP methods?

📘 Explanation

The correct mapping is list() for GET on a collection, retrieve() for GET on a single item, create() for POST, update() for PUT, partial_update() for PATCH, and destroy() for DELETE, which matches DRF's standard ViewSet conventions. The other options rename these methods incorrectly (like detail() or remove()), swap PUT and PATCH between update() and partial_update(), or use Rails-style naming such as index(), show(), and store() that don't apply to DRF.

Related questions

← PreviousNo login needed