AngularJS resource not setting Content-Type

前端 未结 1 1025
暗喜
暗喜 2020-12-19 08:56

I am trying to write an AngularJS resource module that will post some data to the server. The default content-type appears to be \"application/xml\". I am trying to overrid

相关标签:
1条回答
  • 2020-12-19 09:13

    Jake, yesterday I provided some info to a similar question: https://stackoverflow.com/a/12876784/1367284

    Pasting that response below:

    While the development docs (as of 12 Oct) show that overriding headers is possible in a $resource, it hasn't yet been released (v1.0.2 or v1.1.0). The feature is in the v1.0.x and master branches, however. In order to get at that feature, you might consider building from the v1.0.x branch for now.

    How to build: http://docs.angularjs.org/#H1_4

    Alternatively, you could pull from the snapshot build: http://code.angularjs.org/snapshot/

    Looks like this feature will be in the next release.

    0 讨论(0)
提交回复
热议问题