title: tornado post request: missing argument
body: <p>I'm using tornado to build a web server and now I'm creating a login module. Here is the code:<br></p>
  
  <pre><code>&lt;body&gt;
      &lt;form id="uploadForm"&gt;
        &lt;div class="form-group"&gt;
          &lt;label for="exampleInputEmail1"&gt;Email address&lt;/label&gt;
          &lt;input name="name" type="email" class="form-control" id="exampleInputEmail1" placeholder="Email"&gt;
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
          &lt;label for="exampleInputPassword1"&gt;Password&lt;/label&gt;
          &lt;input name="password" type="password" class="form-control" id="exampleInputPassword1" placeholder="Password"&gt;
        &lt;/div&gt;
        &lt;button id="submit" type="button" class="btn btn-default"&gt;Submit&lt;/button&gt;
      &lt;/form&gt;
  &lt;/body&gt;
      &lt;script src="../js/plugins/jquery-3.2.1.min.js?v=c9f5aeeca3"&gt;&lt;/script&gt;
      &lt;script src="../js/common/bootstrap.min.js?v=5869c96cc8"&gt;&lt;/script&gt;
      &lt;script&gt;
          $(function(){
              $('#submit').on('click',function(){
                  $.ajax({
                      url: 'http://www.example.com/login',
                      method: 'POST',
                      data: $('#uploadForm').serialize(),
                      contentType: false,
                      processData: false,
                      cache: false,
                      success: function(data) {
                          console.log(data);
                          if( data === 'ERROR'){
                              alert('login failed')
                          }else{
                              location.href = data;
                          }
                      },
                      error: function (jqXHR) {
                          alert('ERROR');
                      }
                  });
              });
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>And the backend part:<br></p>
  
  <pre><code>class LoginHandler(tornado.web.RequestHandler):
      def post(self, path):
          try:
              print(self.request.body)
              name = self.get_body_argument("name")
          except Exception as e:
              print(e)
  </code></pre>
  
  <p>When I do a test, I can see that <code>print(self.request.body)</code> gives me the result: <code>b'name=test&amp;password=tttt'</code> but after that I get an exception:<br></p>
  
  <blockquote>
    <p>HTTP 400: Bad Request (Missing argument name)</p>
  </blockquote>
  
  <p><code>name=test</code> is just in the http body but why it tells me missing argument name?</p>