如何在angular2中获取RSS提要数据

时间:2016-04-11 05:47:53

标签: google-api rss angular2-services

我试过了

getRSSFeed(url) {
    return this.http.get('https://ajax.googleapis.com/ajax/services/feed/load?v=2.0&q=' + encodeURIComponent(url), { headers: this.header2 })
      .map((res) => res.json());
  }

我收到200状态并收到错误

XMLHttpRequest cannot load https://ajax.googleapis.com/ajax/services/feed/load?v=2.0&q=http%3A%2F%2Fblog.example.com%2Ffeed. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.

我喜欢以json格式获取,因此我使用了这样的https://ajax.googleapis.com/ajax/services/feed/load?v=2.0&q=http://blog.example.com/feed

0 个答案:

没有答案