title: how to access form data using flask?
body: <p>My <code>login</code> endpoint looks like</p>
  
  <pre><code>@app.route('/login/', methods=['GET', 'POST'])
  def login():
      if request.method == 'POST':
          print request.form # debug line, see data printed below
          user = User.get(request.form['uuid'])
          if user and hash_password(request.form['password']) == user._password:
              login_user(user, remember=True)  # change remember as preference
              return redirect('/home/')
      else:
          return 'GET on login not supported'
  </code></pre>
  
  <p>When I test this using <code>curl</code>, the <code>GET</code> call looks like</p>
  
  <pre><code>⮀ ~PYTHONPATH ⮀ ⭠ 43± ⮀ curl http://127.0.0.1:5000/login/
  GET on login not supported
  </code></pre>
  
  <p>but on <code>POST</code>, I am not able to access the form data and get <code>HTTP 400</code></p>
  
  <pre><code>⮀ ~PYTHONPATH ⮀ ⭠ 43± ⮀ curl -d "{'uuid': 'admin', 'password': 'admin'}" http://127.0.0.1:5000/login/
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"&gt;
  &lt;title&gt;400 Bad Request&lt;/title&gt;
  &lt;h1&gt;Bad Request&lt;/h1&gt;
  &lt;p&gt;The browser (or proxy) sent a request that this server could not understand.&lt;/p&gt;
  </code></pre>
  
  <p>On the server though, my debug information prints the following</p>
  
  <pre><code>ImmutableMultiDict([("{'uuid': 'admin', 'password': 'admin'}", u'')])
  </code></pre>
  
  <p>where I do <code>print request.form</code>. I am not able to understand where I am doing wrong</p>