在AngularJS中发布XML
发布时间:2020-12-17 07:50:28 所属栏目:安全 来源:网络整理
导读:我一直在寻找一些angularjs文档的时间,这些文档解释了如何使用$http对象POST xml数据. angular只是不提供它们的$http对象吗?代码: $http({ method: 'POST',url: 'http://10.0.0.123/PHP/itemsGet.php',data: 'searchKey id="whatever"/',headers: { "Conte
我一直在寻找一些angularjs文档的时间,这些文档解释了如何使用$http对象POST xml数据. angular只是不提供它们的$http对象吗?代码:
$http({ method: 'POST',url: 'http://10.0.0.123/PHP/itemsGet.php',data: '<searchKey id="whatever"/>',headers: { "Content-Type": 'application/x-www-form-urlencoded' } })
我来到这里寻找同样的事情,但是我尝试了Skyler的解决方案而且没有用.
我将内容类型更改为’application / xml’并且它有效. 这是片段: $http({ method: 'POST',headers: { "Content-Type": 'application/xml' } }) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
热点阅读