Reputation:
I'm working on django rest framework viewset and want to know which HTTP methods map to the functions:
1.list()
2.create()
3.retrieve()
4.update()
5.partial_update()
6.destroy()
I have searched a lot but I didn't got the specific answer to my question.
So I just want to know which http method maps all the above listed functions
thanks in advance!!
Upvotes: 2
Views: 1388
Reputation: 2770
In simple way you can say:
1.list(): HTTP Get
2.create(): HTTP Post
3.retrieve(): HTTP Get
4.update(): HTTP Put
5.partial_update(): HTTP Patch
6.destroy(): HTTP Delete
Upvotes: 5
Reputation: 827
You can see Django Rest Framework code and see in routers.py file methods mapping, e.g. in SimpleRouter:
Upvotes: 7