Q:

Unable to get http POST data in Django view

I'm using Angular to post some data to a Django endpoint with:
$http({
  method: 'POST',
  url: '/api/projects/166/interval_sort/',
  data: JSON.stringify({ids: [251,250,249,235,233,234]})
})

And in my view method, request. POST is an empty <QueryDict: {}>
def ProjectIntervalSort(request, pk):
  logger.debug("SORTABLE DATA: "+str(request. POST))
  return HttpResponse(status=204)

Chrome's network inspector shows my JSON object being sent, but I don't seem to be able to access it from the Django side.  Am I not formatting the data correctly or missing something in my view method?  Thanks. 

A:

request. POST is for form-encoded data.  You're using JSON, and you can find it in request.body.