title: Data posted to flask endpoint from JS not processed in endpoint
body: <p>I have written a simple todo app with react acting as a frontend and flask handling CRUD from a DB. The app is using axios to handle the requests; <code>GET</code> completes fine however when attempting to <code>POST</code> JSON the flask api returns a 400 error. Here's some condensed sample code.</p>
  <h2>JS POST function.</h2>
  <pre class="lang-js prettyprint-override"><code>  function testPost(){
  
      axios.post('http://'+window.location.hostname+':8000/todo/', {
        title: &quot;test123&quot;,
      }).then(res =&gt; {
        console.log(res)
      }).catch(err =&gt; {
        console.log(err)
      })
  
    }
  </code></pre>
  <h2>Serverside</h2>
  <pre class="lang-py prettyprint-override"><code>class Todo(Resource):
      def post(self): # create a new todo
          conn = pool.getconn()
          cur = conn.cursor()
  
          app.logger.info(request.form['title'])
  
          cur.execute(&quot;INSERT INTO todo (task, done) VALUES (%s, %s)&quot;, (request.form['title'], False))
          conn.commit()
          app.logger.error(e)
          cur.close()
          pool.putconn(conn)
  </code></pre>
  <p>Other methods not shown <br><br>
  Then the rest of the server code attaching the resource to the api and the CORS setup (not shown in file order)</p>
  <pre class="lang-py prettyprint-override"><code>app = Flask(__name__)
  CORS(app, methods=['POST','GET','PUT','DELETE'])
  api = Api(app)
  
  
  api.add_resource(Todo, '/todo/')
  
  app.run(debug = True, host='0.0.0.0', port=port)
  </code></pre>
  <h2>Tests</h2>
  <p>Using python to test the api works fine, running this in a seperate python file will add to the DB.</p>
  <pre class="lang-py prettyprint-override"><code>response = requests.post(URL + &quot;todo/&quot;, data={&quot;title&quot;: f&quot;test{randint(1, 100)}&quot;})
  </code></pre>
  <p>My best guess is that axios is not adding the data to the request in a way that the backend is unable to process. Before using axios I tried to make the request with XMLHttprequest however this presented the same problem. I swapped to axios on the recommendation of someone else, given its alleged improved simplicity.</p>