$resource update method behaving strangely

纵然是瞬间 提交于 2019-12-06 03:14:30

Thank you so much for posting your findings. $.param() caused havoc when used with $httpProvider to send x-www-form-urlencoded data to my server. Was wondering where all those crazy background requests were coming from!

I ran into a the same problem recently using angularjs and codeigniter. It turns out that it depends on how you define your parameters.

var param1 = {'name':'some name'}; 
var param2 = { name :'some name'}; 
$http.post('some url/',$.param(param1),....); // babies die
$http.post('some url/',$.param(param2),....); // nuclear war averted
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!