I'm trying to create a flask service in which I want to send the data coming from one request.form to another url in json format, Please can anyone help me to achieve this?
redirect(url_for('any_method'), json = json.dumps(my_form_dict))
When I try to execute the above code I'm getting following error:
TypeError: redirect() got an unexpected keyword argument 'json' The above is the error here.
You can redirect POST requests using 307 status code. Use:
redirect(url_for('any_method', json=json.dumps(my_form_dict)), code=307)
For more information refer to this answer: Make a POST request while redirecting in flask
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