title: Flask - POST - The method is not allowed for the requested URL
body: <p>I just started learning Flask but I meet troubles with the POST method.</p>
  
  <p>Here is my (very simple) Python code :</p>
  
  <pre><code>@app.route('/test')
  def test(methods=["GET","POST"]):
      if request.method=='GET':
          return('&lt;form action="/test" method="post"&gt;&lt;input type="submit" value="Send" /&gt;&lt;/form&gt;')
  
      elif request.method=='POST':
          return "OK this is a post method"
      else:
          return("ok")
  </code></pre>
  
  <p>when going to :
  <a href="http://127.0.0.1:5000/test" rel="noreferrer">http://127.0.0.1:5000/test</a></p>
  
  <p>I successfully can submit my form by clicking on the send button but I a <strong>405 error is returned</strong> :</p>
  
  <p><strong><em>Method Not Allowed
  The method is not allowed for the requested URL.</em></strong></p>
  
  <p>It is a pretty simple case, but I cannot understand where is my mistake.</p>