twilio/flask-restful — pull request #147 by lanceingle (2013-11-01 20:53:50+00:00)
Title: Add json as a default location to search for values.

AngularJS sends data as a json payload by default. By adding 'json' to the default location tuple Flask-Restful will find the data sent from AngularJS as well as keeping backwards compatibility to more traditional forms sending data to the server.

This keeps the developer of the API from having to specify location=('json','values',) on every add_argument call.

Putting 'json' first won't have any adverse effects since the first thing the json property in the Flask request base class does is check the content-type of the request.

You must put 'json' first in the location param because 'values' will return an list of empty MultiDicts.. that is not None see line 75 of reqparse.py