Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use request.data instead of request.DATA #60

Open
kevinetienne opened this issue May 5, 2016 · 1 comment
Open

Use request.data instead of request.DATA #60

kevinetienne opened this issue May 5, 2016 · 1 comment

Comments

@kevinetienne
Copy link
Contributor

I'm not sure if Django uses request.data still, but django-rest-framework requires request.data instead of request.DATA.

Changing it for the lowercase version in api_request would make it easy to write test when the request is set as a view attribute in tests.

Example:

view = MyView()
view.request = self.create_request(data={})
@meshy
Copy link
Collaborator

meshy commented May 5, 2016

request.DATA is a remnant of DRF 2, and can be replaced in newer versions.

Django used to have request.REQUEST, which was similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants