I am in my views.py and I need to go to a url with post request along with post data.
I tried HttpResponseRedirect but it does not take post data as param.
class WebPaymentView(FormView):
template_name = "payment/payment.html"
form_class = NameForm
def form_valid(self, form):
# code
return HttpResponseRedirect(url, data=data, content_type="application/x-www-form-urlencoded")
Last line gives error:
TypeError: __init __() got an unexpected keyword argument 'data'
I want to post to this url as well as redirect to it. Any idea how?