As per subject, I am receiving a POST request. I want to convert it to the equivalent GET request and pass it to a template (so I can use it as href target in click-to-sort column headers).
Is there a pre-baked way to do it, or do I need to roll my own?
Cheers, alf
UPDATE
This is what I eventually used. I needed request.REQUEST, so request.POST.urlencode was not cutting it, and request.REQUEST does not have urlencode.
import urllib
def buildqs(request):
"Builds a GET-style query string form http-request"
#also request.POST.urlencode is possible -
#Sadly, request.REQUEST does not have urlencode
return urllib.urlencode(request.REQUEST)+"&"
Use
request.POST.urlencode()
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