0
I’m using Django Restless views to build some REST interfaces and in all posts the request.POST and request.params are empty.
In case I run:
print request
print request.POST
I have the following return:
<WSGIRequest: POST '/ambiente/alo/cadastrosplash/448/'>
<QueryDict: {}>
Follows the header of the method you inherit from Restless.views.Endpoint:
from restless.views import Endpoint
class CadastroSplash(Endpoint):
def post(self, request, idCampanha, **kwargs):
In the.py url, the configuration is this way:
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())),
]
This way the "post" method is executed correctly, the value of the parameter idCampanha
is filled in, but with empty request fields.
If I create a view method the request comes correctly filled, but it is something I would not like to do for the sake of standardization of methods.
Some additional information: I’m using Jango with apache2 and WSGI module. The form is a Multipart/form-date 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 your attention