title: FLASK Restful API not able to add using PUT
body: <p>I am using this documentation: from FLASK Restful </p>
  
  <pre><code>from flask import Flask, request
  from flask_restful import Resource, Api
  
  app = Flask(__name__)
  api = Api(app)
  
  todos = {}
  
  class TodoSimple(Resource):
      def get(self, todo_id):
          return {todo_id: todos[todo_id]}
  
      def put(self, todo_id):
          todos[todo_id] = request.form['data']
          return {todo_id: todos[todo_id]}
  
  api.add_resource(TodoSimple, '/&lt;string:todo_id&gt;')
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p>In order to add
  the new todo, they call the following command on python: </p>
  
  <pre><code>from requests import put, get
  put('http://localhost:5000/todo1', data={'data': 'Remember the milk'}).json()
  </code></pre>
  
  <p>The data comes from the json object  {'data': '.....}
  and it retrieved here: <code>request.form['data']</code></p>
  
  <p>I want to replace 'Remember the milk' with my data2 object:</p>
  
  <pre><code>data2 = {'ALTNUM':'noalt', 'CUSTTYPE': 'O',
  'LASTNAME':'lnamedata2', 'FIRSTNAME':'fndata2', 'ADDR':'1254 data 2 address',
  'ADDR2':'apt 3', 'CITY':'los angeles', 
  'COUNTY':'011', 'STATE':'CA', 
  'ZIPCODE':'90293', 'COUNTRY':'001', 
  'ADDR_TYPE':'O','PHONE':'4254658029',
  'PHONE2':'3442567777', 
  'EMAIL':'test2@test2.com'}
  </code></pre>
  
  <p>and call: <code>print put('http://localhost:5000/newcustomer', data={'data':data2}).json()</code></p>
  
  <p>MY API resource: </p>
  
  <pre><code>class New_Customer(Resource):
      def put(self):
          q = PHQuery()
          data = request.form['data']
          print(data)
          return data
  </code></pre>
  
  <p>I get the following errors when calling these:</p>
  
  <pre><code>print put('http://localhost:5000/newcustomer', data=data2).json()
  print put('http://localhost:5000/newcustomer', data={'data':data2}).json()
  print put('http://localhost:5000/newcustomer', data=data2).json()
  print put('http://localhost:5000/newcustomer', data=data2)
  
  
  
  {u'message': u'The browser (or proxy) sent a request that this server could not understand.'}
  CUSTTYPE
  {u'message': u'The browser (or proxy) sent a request that this server could not understand.'}
  &lt;Response [400]&gt;
  </code></pre>
  
  <p>What am I doing wrong?
  @foslock should it be data = request.json['data'] ? since it is an object and not form data?</p>