我试过了
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