This is working fine in angular js
$http.defaults.headers.post['X-CSRFToken'] = $cookies['csrftoken'];
$http.defaults.headers.put['X-CSRFToken'] = $cookies['csrftoken'];
$http.defaults.headers.patch['X-CSRFToken'] = $cookies['csrftoken'];
But this is not working
$http.defaults.headers.delete['X-CSRFToken'] = $cookies['csrftoken'];