I am sending a delete request with this code:
$http({method: 'DELETE', url: '/url'}).
success(function(status){
//return status
}).
error(function(status){
});
and I set csrf in app.run() as following:
$http.defaults.headers.post['X-CSRFToken'] = getCookie("csrftoken");
GET and POST are working fine that means that the header contains a csrf token but while sending a DELETE request I am getting 403 Forbidden error and the status:
detail: "CSRF Failed: CSRF token missing or incorrect."
Is the anything extra I need to add to the header of the DELETE request?
POSTrequests. Try$http.defaults.headers.delete['X-CSRFToken']as well - Phil