title: Send JSON to Flask using requests
body: <p>I am trying to send some JSON data to a Flask app using the requests library.  I expect to get <code>application/json</code> back from the server.  This works fine when I use Postman, but when I use requests I get <code>application/html</code> back instead.</p>
  
  <pre><code>import requests
  server_ip = 'server_ip:port/events'
  headers = {'Content-Type': 'application/json'}
  event_data = {'data_1': 75, 'data_2': -1, 'data_3': 47, 'data_4': 'SBY'}
  server_return = requests.post(server_ip, headers=headers, data=event_data)
  print server_return.headers
  {'date': 'Fri, 05 Jun 2015 17:57:43 GMT', 'content-length': '192', 'content-type': 'text/html', 'server': 'Werkzeug/0.10.4 Python/2.7.3'}
  </code></pre>
  
  <p>Why isn't Flask seeing the JSON data and responding correctly?</p>