Your files never leave your device
Advertisement

Fetch API & HTTP Requests

The Fetch API allows your browser to request data from servers and APIs without reloading the page.

Basic Fetch Request

Fetch uses Promises. You call fetch(), then use .then() to handle the response when it arrives.

Try It Yourself

        

Practice

Challenge 1: Modify the code above to fetch user number 2 from https://jsonplaceholder.typicode.com/users/2 and log their name.

Related Guides

Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement