Allow body on HTTP DELETE view methods (#122)

* Allow body in delete requests
* Do not add request body to DELETE by default
* Check manual form parameters against body_methods
* Add tests
* Add changelog

Closes #118
This commit is contained in:
Cristi Vîjdea
2018-05-14 19:15:14 +03:00
committed by GitHub
parent 3077195396
commit aca0c4713e
5 changed files with 68 additions and 16 deletions
+4 -1
View File
@@ -276,7 +276,10 @@ class SerializerInspector(FieldInspector):
class ViewInspector(BaseInspector):
body_methods = ('PUT', 'PATCH', 'POST') #: methods that are allowed to have a request body
body_methods = ('PUT', 'PATCH', 'POST', 'DELETE') #: methods that are allowed to have a request body
#: methods that are assumed to require a request body determined by the view's ``serializer_class``
implicit_body_methods = ('PUT', 'PATCH', 'POST')
# real values set in __init__ to prevent import errors
field_inspectors = [] #: