Hello,
I'm discovering DRF.
Is it possible to send HTTP DELETE or PATCH from DRF web page ?
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