title: Can't send POST request to my basic FLASK Python application
body: <p>I am trying to test the basic HTTP requests in my simple rest api using Flask framework in Python. The GET method worked just fine not the POST method yet. here is the route:</p>
  
  <pre><code>@app.route('/lang', methods=['POST'])
  def addOne():
      language = {'name' : request.json['name']}
      languages.append(language)
      return jsonify({'languages' : languages}) 
  </code></pre>
  
  <p>My languages dictionary: </p>
  
  <pre><code>languages = [{'name' : 'JavaScript'},{'name' : 'Java'}, {'name' : 'Python'}]
  </code></pre>
  
  <p>I am trying to use Postman application to post a new language to the dictionary, here is the request:</p>
  
  <pre><code>http://127.0.0.1:8080/lang
  </code></pre>
  
  <p>And in the body, row I placed this: </p>
  
  <pre><code>{"name" : "C++"}
  </code></pre>
  
  <p>It gives me this error:</p>
  
  <pre><code>  File "/home/pi/IoT_api/restful.py", line 22, in addOne
      language = {'name' : request.json['name']}
  TypeError: 'NoneType' object has no attribute '__getitem__'
  </code></pre>