Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed JavaScript Data Fetching!
You have completed JavaScript Data Fetching!
Preview
Discover how to use the Fetch API to make HTTP requests in a simpler, more readable way. Work with promises to fetch and use data from the Dog API.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Fetch is a modern built in browser
function that lets you make HTTP requests
0:00
just like we saw earlier with XHR,
except now in a much simpler, cleaner way.
0:03
And just in case you're wondering,
the reason it's called the fetch API
0:08
is because it's literally a tool
for fetching resources from a server.
0:12
While you've already learned
that APIs are ways to get or send data,
0:16
fetch emphasizes that this function is all
about requesting and retrieving data.
0:20
You give it a URL,
and it goes out to get the resource
0:25
for you,
returning a promise with a response.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up