POST-ing XML in AngularJS

后端 未结 2 2025
醉梦人生
醉梦人生 2020-12-20 04:05

I\'ve been looking for hours for some angularjs documentation that explains how to POST xml data using the $http object. Does angular simply not of

2条回答
  •  一向
    一向 (楼主)
    2020-12-20 04:40

    I came here looking for the same thing, however I tried Skyler's solution and it did not work. I changed the content type to 'application/xml' and it worked. Here is the snippet:

    $http({ 
        method: 'POST',
        url: 'http://10.0.0.123/PHP/itemsGet.php',
        data: '',
        headers: { "Content-Type": 'application/xml' }
    })
    

提交回复
热议问题