[Fixed]-Example when request.POST contain query string in django


If your request is post:

request.method == ‘POST’

but the requested url contains a query string. e.g:


you can still take POST parameters through:

request.POST.get("my-field", None)

and query string parameters through:


althrough, you pick up all parameters at once (POST and GET), through REQUEST:

request.REQUEST[‘param1’] # comes from query string

request.REQUEST[‘my-field’] # comes from request BODY (POST)

Leave a comment