Are the parameters in request.POST and request.GET BOTH in request.REQUEST ? Or i have to check for each of them ?
I can't find a clear info in the documentation for both REQUEST/QueryDict. NB: Django 1.4 Final
No, this was possible in older versions but was depreciated in Django 1.7. For Django archeologists running ancient versions, keep reading.
From the documentation:
HttpRequest.REQUEST
For convenience, a dictionary-like object that searches POST first, then GET. Inspired by PHP’s $_REQUEST.
For example, if GET = {"name": "john"} and POST = {"age": '34'}, REQUEST["name"] would be "john", and REQUEST["age"] would be "34".
It’s strongly suggested that you use GET and POST instead of REQUEST, because the former are more explicit.
If you're not sure which you need to use, if can be handy to replace with this :
def get_post_or_get(request):
"""
Return the equivalent of request.REQUEST
which has been removed in Django 1.9
"""
return request.POST or request.GET
reference : https://github.com/edx/django-openid-auth/pull/5/commits/aa5eef791cd487eb359db25011572d5966a2c92a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With