我花了几个小时寻找一些 angularjs
文档,这些文档解释了如何使用 $http
对象发布 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' }
})
最佳答案
我来这里寻找同样的东西,但是我尝试了斯凯勒的解决方案,但它不起作用。 我将内容类型更改为“application/xml”并且它有效。 这是片段:
$http({
method: 'POST',
url: 'http://10.0.0.123/PHP/itemsGet.php',
data: '<searchKey id="whatever"/>',
headers: { "Content-Type": 'application/xml' }
})
关于xml - 在 AngularJS 中发布 XML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28373756/