I am working with flask. I am in a situation where I need to redirect a post request to another url preserving the request method i.e. "POST" method. When I redirected a "GET" request to another url which accepts "GET" request method is fine. Here is sample code with which I am trying the above..
@app.route('/start',methods=['POST'])
def start():
flask.redirect(flask.url_for('operation'))
@app.route('/operation',methods=['POST'])
def operation():
return "My Response"
I want to make a "POST" request to "/start" url which internally also makes a "POST" request to "/operation" url.If I modify code as like this,
@app.route('/operation',methods=['GET'])
def operation():
return "My Response"
code works fine for "GET" request. But I want to be able to make POST request too.