I'm using django restless views to build some REST interfaces and in all posts the request.POST and request.params are blank.
If I run:
print request
print request.POST
I have the following return:
<WSGIRequest: POST '/ambiente/alo/cadastrosplash/448/'>
<QueryDict: {}>
The following is the header of the methods that inherit from restless.views.Endpoint:
from restless.views import Endpoint
class CadastroSplash(Endpoint):
def post(self, request, idCampanha, **kwargs):
In url.py, the setting looks like this:
from django.views.decorators.csrf import ensure_csrf_cookie
from meuprojeto.meupacote.views import CadastroSplash
urlpatterns = [
url(r'^cadastrosplash/(?P<idCampanha>\d{1,8})/$$',
ensure_csrf_cookie(CadastroSplash.as_view())),
]
In this way the "post" method is executed correctly, the value of the idCampanha
parameter is filled, however with empty request fields.
If I create a view method the request comes correctly filled, but it's something I would not want to do for the sake of standardizing methods.
Some additional info: I'm using django with apache2 and WSGI module. The form is a multipart / form-data for uploading files. There is this same application running with django 1.5 and djangorestless 0.0.9 on the same server in a separate virtualenv, this method works correctly and receives all parameters.
Thank you all for the attention