title: How can we call one route from another route with parameters in Flask?
body: <p>I am sending a POST request from one form with two inputs to a Flask route.</p>
  <pre><code>  &lt;form action = &quot;http://localhost:5000/xyz&quot; method = &quot;POST&quot;&gt;
       &lt;p&gt;x &lt;input type = &quot;text&quot; name = &quot;x&quot; /&gt;&lt;/p&gt;
       &lt;p&gt;y &lt;input type = &quot;text&quot; name = &quot;y&quot; /&gt;&lt;/p&gt;
       &lt;p&gt;&lt;input type = &quot;submit&quot; value = &quot;submit&quot; /&gt;&lt;/p&gt;
    &lt;/form&gt;
  </code></pre>
  <p>The Flask code is like this.</p>
  <pre><code>@app.route('/xyz', methods = ['POST', 'GET'])
  def xyz():
      if request.method == 'POST':
         x = request.form[&quot;x&quot;]
         y = request.form[&quot;y&quot;]
         callonemethod(x,y)
      return render_template('index.html', var1=var1, var2=var2)
         #abc(x,y) #can i call abc() like this .i want to call abc() immediately, as it is streaming log of callonemethod(x,y) in console.
  
  @app.route('/abc', methods = ['POST', 'GET'])       
  def abc():
      callanothermethod(x,y)
      return render_template('index.html', var1=var3, var2=var4)
      #I want to use that x, y here. also want to call abc() whenever i call xyz()
  </code></pre>
  <p>How can I call one route from another route with parameters in Flask?</p>