Skip to Content
Learn
Requests II
Review Requests II

Let’s recap on the concepts covered in the previous exercises:

  1. GET and POST requests can be created a variety of ways.

  2. Use AJAX to asynchronously request data from APIs. fetch() and async/await are new functionalities developed in ES6 (promises) and ES8 respectively.

  3. Promises are a new type of JavaScript object that represent data that will eventually be returned from a request.

  4. fetch() is a web API that can be used to create requests. fetch() will return promises.

  5. We can chain .then() methods to handle promises returned by fetch().

  6. The .json() method converts a returned promise to a JSON object.

  7. async is a keyword that is used to create functions that will return promises.

  8. await is a keyword that is used to tell a program to continue moving through the message queue while a promise resolves.

  9. await can only be used within functions declared with async.

Instructions

Congratulations on learning all about AJAX requests using fetch(), async, and await! These concepts are fundamental and will help you develop more robust web apps!

Play around the with browser and code to make GET and POST requests. If you’re going to make POST requests, make sure you assign apiKey your Rebrandly API key and run the code!

If you want to challenge yourself:

  • Rewrite the requests from scratch.
  • Replace the helper methods with your own code.
  • Use different APIs to make GET/POST requests using async/await.
Folder Icon

Take this course for free

Already have an account?