Change the Content-type
to application/json
headers: {
'Content-Type': 'application/json'
}
It's also worth noting that the default angular $http POST
behavior is to send the data as JSON. So another strategy might be to remove headers
from your $http
call altogether.
Also, you may want to use simplejson
rather than json
The following explanation was taken from this question:
json
is simplejson
, added to the python stdlib. But since json
was added in 2.6, simplejson
has the advantage of working on more Python versions (2.4+).
simplejson
is also updated more frequently than Python, so if you need (or want) the latest version, it's best to use simplejson
if possible.