Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

When I make a DELETE request with AngularJS $resource module, angular adds a Content-Type: application/xml header to request headers. In AngularJS source code, there is a section that removes content-type request header when no parameters sent. But, I don't understand why this is happen, this doesn't works.

Here is how I make delete request:

$resource('/my/topics/:topicId').remove({ topicId: 1}, successFn, errorFn

And here is which headers browser

Accept:application/json, text/plain, */*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:0
Content-Type:application/xml
Cookie:session=0a627145415440740d6cc8cd35d19ba3; __ngDebug=true
Host:localhost:9001
Origin:http://localhost:9001
Referer:http://localhost:9001/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36

Where that Content-Type header come from?

EDIT: I'm using AngularJS 1.2.0rc1

share|improve this question
    
which version of angular you are using –  Ajay Beniwal Sep 4 '13 at 16:26
    
Oh, sorry. I added version of AngularJS that I'm using. –  Murat Corlu Sep 4 '13 at 17:17
    
add comment

1 Answer

up vote 1 down vote accepted

I found workaround: https://github.com/angular/angular.js/issues/2149#issuecomment-22664501

I hope somebody merge this fix to angularjs master.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.