Requests
HttpRequest.REQUEST
Deprecated since Django 1.7
Removed since Django 1.9
For convenience, a dictionary-like object that searches
POST
first, thenGET
. Inspired by PHP’s$_REQUEST
For example, if
GET = {"name": "john"}
andPOST = {"age": '34'}
,REQUEST["name"]
would be"john"
, andREQUEST["age"]
would be"34"
It’s strongly suggested that you use
GET
andPOST
instead ofREQUEST
, because the former are more explicitSupport both
GET
andPOST
param = request.REQUEST.get('param', '') # Before Django 1.9 param = request.GET.get('param') or request.POST.get('param', '') # All Django Version