You asked a very basic question and the answer, in all cases, is yes. You need to RTM (https://www.django-rest-framework.org/), it's all in there.
On Wed, Apr 22, 2020 at 10:44 AM Linovia <xordo...@linovia.com> wrote: > Hi, > > If you are referring to the browsable API, you should see a DELETE request. > If you are unsure, check the django server logs, you’ll see a DELETE. > The delete button is wrapped in the following form: > > <form class="button-form" action="/snippets/4/" data-method="DELETE"> > <button class="btn btn-danger">Delete</button> > </form> > > However browsers may not correctly show operations other than GET or POST. > > Regards, > Xavier O. > Linovia. > Le 22 avr. 2020 à 15:41 +0200, Olivier Krief <oza.4...@gmail.com>, a > écrit : > > Hello, > > I'm discovering DRF. > > Is it possible to send HTTP DELETE or PATCH from DRF web page ? > > > > > > When I type http://foo/api/friends/3/ in my browser, I'm seeing content > describing Friend 2 or Friend 3 instance. > > When I type curl -X DELETE http://foo/api/friends/2/ a DELETE request is > sent to my Django app and everything works OK as Friend 2 is removed from > database. > > When looking at Friend 3 instance, I can see a DELETE and a Delete buttons. > When I click over DELETE then Delete buttons, a GET request is sent over > to my Django instance. > I would expect a DELETE request to be sent. > > I tried this with both Firefox 68 ESR and Chromium 57 and with both a GET > request is sent instead of a DELETE one. > I also tried with PATCH button: a GET request is also sent. > > Looking at this HTTP request capture, I do not see any evidence reflecting > a DELETE or PATCH intent. > Looking at page HTML source code, I can see that buttons are mapped to GET > request with an intriguing "data-method" set to DELETE or PATCH. > > > 1. Is it possible to have these browsers sending expected DELETE or PATCH > requests ? > Is it something that can be configured by Django ? Within browsers > themselves ? > > 2. Is it possible to have these browsers still sending GET request but > have my Django app mapping these requests to the DELETE/PATCH/whatever > methods these requests are supposed to be mapped to ? > > > Best regards > > -- > You received this message because you are subscribed to the Google Groups > "Django REST framework" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-rest-framework+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-rest-framework/85f74627-1f5c-403d-845b-fcc87fea5202%40googlegroups.com > <https://groups.google.com/d/msgid/django-rest-framework/85f74627-1f5c-403d-845b-fcc87fea5202%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "Django REST framework" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-rest-framework+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-rest-framework/5fb29489-e0ab-4479-9a4d-21726ee5f380%40Spark > <https://groups.google.com/d/msgid/django-rest-framework/5fb29489-e0ab-4479-9a4d-21726ee5f380%40Spark?utm_medium=email&utm_source=footer> > . > -- ------------------------------------------------------------------------------- Carl J. Nobile (Software Engineer) carl.nob...@gmail.com ------------------------------------------------------------------------------- -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/CAGQqDQLZaJVFMmJB-zRywLAPiS%3D%2B2mp0SWxbLguDTyXWUyS-cw%40mail.gmail.com.