Getting 200 response, but also CORS error?

Discussão em 'Angular' iniciado por user5823669, Julho 30, 2025.

  1. user5823669

    user5823669 Guest

    I am making a request to the third option on this page: http://www.groupkt.com/post/5c85b92...earch-states-and-territories-of-a-country.htm

    Im getting back the response I want, but I also get a CORS error which makes no sense to me... They said they have CORS enabled


    results.component.ts:28 results;state=:1 Failed to load http://services.groupkt.com/state/search/USA?text=: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    ​

    let headers = new Headers();
    headers.append('Content-Type', 'text/plain');
    let options = new RequestOptions({ headers: headers });
    return this.http.get('http://services.groupkt.com/state/search/USA?text=cal', options)
    .map(this.extractData)
    .catch(this.handleError);


    The only way I have been able to get around this problem is to download a chrome extension that fixes CORS. But this is a project I need to hand in, so I doubt telling someone to download an extension is going to go over so well...

    Yes I have cleared browser cache.

    Continue reading...

Compartilhe esta Página