title: How to handle several parameters containing slashes?
body: <p>I have a Flask app to which I need to pass several parameters containing slashes. For example, I have  <code>parameter1 = "Clothes/Bottoms"</code> and <code>parameter2 = "Pants/Jeans"</code>. I tried doing it this way:</p>
  
  <p>In my HTML/JS:</p>
  
  <pre class="lang-js prettyprint-override"><code>par1 = encodeURIComponent(parameter1);
  par2 = encodeURIComponent(parameter2);
  console.log("Par1 = ",par1," par2 = ",par2);
  $.ajax({
       type:'post',
       url:'/get_data'+'/'+par1+'/'+par2,
       ....
  });
  </code></pre>
  
  <p>and in my <code>app.py</code>:</p>
  
  <pre class="lang-py prettyprint-override"><code> @app.route('/get_data/&lt;path:par1&gt;/&lt;path:par2&gt;/',methods=['GET','POST'])
   def get_data(par1, par2):
       print("In get_data with par1 ",par1," and par2 ",par2)
       ....
  </code></pre>
  
  <p>I can see from Javascript print-outs that both parameters look fine after being encoded, but then the Python print out is:</p>
  
  <pre><code> In get_data with par1 Clothes and par2 Bottoms/Pants/Jeans
  </code></pre>
  
  <p>So it somehow mistakes the slash in <code>par1</code>'s <code>"Clothes/Bottoms"</code> for part of the URL and shifts <code>"Bottoms"</code> into <code>par2</code>.</p>
  
  <p>Is there a better way to handle multiple parameters with slashes than just adding <code>path:</code>? </p>