title: try except JSON Error in Flask
body: <p>I am trying to add to an API a DELETE method as follows:</p>
  
  <pre><code>if request.method == 'DELETE':
  
      if request.headers['Content-Type'] == 'application/json':
  
          try:
              data = json.loads(request.data)
              data_id = data['id']
              db.execute('DELETE FROM places WHERE id=' + data_id)
              db.commit()
              resp = Response({"Delete Success!"}, status=200, mimetype='application/json')
              return resp
  
          except (ValueError, KeyError, TypeError):
              resp = Response({"JSON Format Error."}, status=400, mimetype='application/json')
              return resp
  </code></pre>
  
  <p>I am passing the following CURL:</p>
  
  <pre><code>curl -H "Content-type: applicaiton/json" -X DELETE http://localhost:5000/location -d '{"id":3}'
  </code></pre>
  
  <p>The try except block is failing for some reason. I am unable to detect what the issue is. Any ideas how I can debug this?</p>