Sending post data from angularjs to django as JSON and not as raw content
In my case works something like
$http({ url: '/url/', method: "POST", data: $.param(params), headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }})
Or more nice variant:
app.config ($httpProvider) -> ... $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
and then
$scope.save_result = $http.post('/url/', $.param(params))
http://www.daveoncode.com/2013/10/17/how-to-make-angularjs-and-django-play-nice-together/
I am using zope2 where I used simplejson to decode the request json into python dictionary as:
request_dict = simplejson.loads(request.get('BODY','')
It's working correctly for me. In this way I am able to use angularjs default json request rather than converting it into form post.