title: Ajax, CSRF and DELETE
body: <p>I use the <code>getCookie</code> function from the <a href="https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax"><code>django</code> documentation</a> to get the <code>csrfmiddlewaretoken</code> value.</p>
  
  <p>I have the following ajax call:</p>
  
  <pre><code>var url = reverse_removeprofile.replace(/deadbeef/, key);
  $.ajax({
      type:          "DELETE",
      url:           url,
      data:          "csrfmiddlewaretoken=" + getCookie("csrftoken"),
      success:       function() { ... },
  });
  </code></pre>
  
  <p>When this code gets executed then <code>django</code> raises a 403 exception telling me that the CSRF verification failed. However, if I change the <code>type</code> from <code>DELETE</code> to <code>POST</code> then <code>django</code> is happy about it and doesn't complain at all.</p>
  
  <p>I was not really able to find something useful in Google about this, but I've found this (now closed and fixed) ticket: <a href="https://code.djangoproject.com/ticket/15258">https://code.djangoproject.com/ticket/15258</a></p>
  
  <p>If I understand it correctly then this issue has been fixed in the 1.4 milestone. I use django 1.4 but still I cannot verify the CSRF token with a <code>DELETE</code> request.</p>
  
  <p>Am I missing something here?</p>