title: Python - HTTP POST 'Response' object is not subscript-able
body: <p>I have below code in Python3 that receives a POST request. Example request shown later. </p>
  
  <p>I see that the POST request is coming properly. The JSON data that comes through POST has 2 keys- <code>"id"</code> and <code>"ingredients"</code>. But when I try to access the data based on the keys for example content["id"] like below, it shows error </p>
  
  <blockquote>
    <p>TypeError: 'Response' object is not subscriptable</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>@app.route('/cuisine/api/json',methods=['POST'])
  def getCuisine():
      content = jsonify(request.json)
      return content["id"]
  </code></pre>
  
  <p>Example CURL</p>
  
  <pre><code>curl --header "Content-Type: application/json"   --request POST   --data '{"id": 10259,"ingredients": ["romaine lettuce","black olives","grape tomatoes","garlic","pepper","purple onion","seasoning","garbanzo beans","feta cheese crumbles"]}'   http://127.0.0.1:5000/cuisine/api/json
  </code></pre>
  
  <p>I think I followed <a href="https://stackoverflow.com/questions/34508981/response-object-is-not-subscriptable-python-http-post-request">this post</a> properly but doesn't work. What am I missing?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Full error traceback</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__
      return self.wsgi_app(environ, start_response)
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
      response = self.handle_exception(e)
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception
      reraise(exc_type, exc_value, tb)
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
      raise value
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
      response = self.full_dispatch_request()
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
      raise value
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
      rv = self.dispatch_request()
    File "/Users/MacUser/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "/Users/MacUser/Desktop/cuisine-prediction/webservice.py", line 62, in getCuisine
      return content["id"]
  TypeError: 'Response' object is not subscriptable
  </code></pre>