title: Sending JSON to Flask, request.args vs request.form
body: <p>My understanding is that <code>request.args</code> in Flask contains the URL encoded parameters from a <code>GET</code> request while <code>request.form</code> contains <code>POST</code> data. What I'm having a hard time grasping is why when sending a <code>POST</code> request, trying to access the data with <code>request.form</code> returns a <code>400</code> error but when I try to access it with <code>request.args</code> it seems to work fine.</p>
  
  <p>I have tried sending the request with both <code>Postman</code> and <code>curl</code> and the results are identical.</p>
  
  <pre><code>curl -X POST -d {"name":"Joe"} http://127.0.0.1:8080/testpoint --header "Content-Type:application/json"
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>@app.route('/testpoint', methods = ['POST'])
  def testpoint():
      name = request.args.get('name', '')
      return jsonify(name = name)
  </code></pre>