How to solve problem with CORS using IMDB autocomplete API

2830 views javascript

I want to use API url for using imdb autocomplete in my test project, but when I try use it I get CORS error.

Failed to load No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. home.component.ts:52

TypeError: Failed to fetch

Can anyone tell me how I can fix this problem?

answered question

1 Answer


When you use already a web server, you have to define your CORS Settings. Here is a good intro to that. You might also need adoc how to set it for your Webserver.

When you still in development you can either use a browser plugin which disables cors or use angular proxy to redirect your calls

posted this

Have an answer?


Please login first before posting an answer.