K
K
Konstantin Kudelko2018-06-21 14:26:07
Angular
Konstantin Kudelko, 2018-06-21 14:26:07

Why can't I get rss via http.get?

Can't get service rss via service:

import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';

import { rssAPI } from '../../app.constants';

@Injectable()
export class RSSService {
  constructor(
    private http: HttpClient,
  ) {}

  public getRSS(): Observable<any> {
    return this.http.get('https://www.presseportal.de/rss/bau-immobilien.rss2');
  }
}


I get this error:

Failed to load https://www.presseportal.de/rss/bau-immobilien.rss2 : Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' localhost:4200 ' is therefore not allowed access.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2018-06-21
@RidgeA

CORS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question