如何使用Javascript发布RSS [英] How do I publish RSS using Javascript

查看:65
本文介绍了如何使用Javascript发布RSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个Angular + ASP.Net WebAPI应用程序。我正在向API发布JSON查询,并获得RSS格式的Feed。

Hi,

I have an Angular + ASP.Net WebAPI Application. I am posting a JSON query to an API and in return getting the RSS formatted feed.

$scope.rss = function(query){
   $http.post("api/url", query)
      .success(function(response){
         //I have RSS feed (xml string) in response
         //But cannot publish it as RSS
         /*response = "<?xml version="1.0" encoding="UTF-8" ?>
                         <rss version="2.0">
                           <channel>
                              ...
                           </channel>
                         </rss>"*/
      })
      .error(function(e){
         //error
      });
}





现在,我的API接受 HttpPost ,而我不能使用 HttpGet 因为,查询可以变得非常大。有没有办法解决它?



Now, my API accepts HttpPost, and I cannot use HttpGet because, the query can get really big. Is there any way to solve it?

推荐答案

scope.rss = function (查询){
scope.rss = function(query){


http.post( api / url,query)
.success( function (response){
// 我有RSS feed(xml字符串)作为回应
// 但是无法将其发布为RSS
/ * response =<?xml version =1.0 encoding =UTF-8?>
< rss version =2.0>
< channel>
...
< / channel>
< / rss>* /

})
.error( function (e){
// error
});
}
http.post("api/url", query) .success(function(response){ //I have RSS feed (xml string) in response //But cannot publish it as RSS /*response = "<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> ... </channel> </rss>"*/ }) .error(function(e){ //error }); }





现在,我的API接受 HttpPost ,而我不能使用 HttpGet 因为,查询可以变得非常大。有什么办法可以解决吗?



Now, my API accepts HttpPost, and I cannot use HttpGet because, the query can get really big. Is there any way to solve it?


这篇关于如何使用Javascript发布RSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆