views:

85

answers:

1

Please post example code when request.POST contain query string in django, because i think my django version is bugged.

EDIT:

You simple can't, query string is always in GET, and this was my problem.

+2  A: 

If your request is post:

request.method == 'POST'

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

/your-url?param1=value-one

you can still take POST parameters through:

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

and query string parameters through:

request.GET.get("param1")

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)

Gabriel Falcão
This is what i needed, query strings are always in GET...
SuitUp