This lesson introduces the native JavaScript Promise
object and the Promise.prototype.then()
method. We’re gonna look at how to make an HTTP request using the Fetch API and how to asynchronously process the response in a promise chain.
In addition, we'll discuss the three mutually exclusive states a promise can be in: pending, fulfilled, or rejected.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://starwars.egghead.training/films. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)
Current start wars API is no longer working :/
@Carlos: Apologies for the inconveniences. The API should be back up and running!
API still not working.
The current API used in videos is down. You can use this one if you want to reproduce the tutorial. You will need to make some changes in the code but it's better than no API ! https://swapi.dev/api/films/1/