Django-piston: availability of request.data in DELETE handlers

django-piston seems to create a data attribute in the request object before it enters the handler phase. This data is available, for example, in PUT and POST handlers, referring to request.data.

However, data is not available in the DELETE handler.

I would like to modify django-piston to make this data available, but I have no real idea of ​​where to start. Any ideas? Where does the data attribute come from?

+3
source share
1 answer

I decided it for myself. The short hacker answer is that the method

translate_mime(request)

from piston.utils, you need to execute a query to make the data attribute available.

Piston resource.py translate_mime DELETE-. PUT POST.

, , translate_mime , .

+5

Source: https://habr.com/ru/post/1791316/


All Articles