Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Learn how to simplify your fetch requests by creating a reusable data-fetching function that runs the fetch, returns the response in JSON, and more.
Code Snippets
fetchData(`https://dog.ceo/api/breed/${breed}/images/random`)
You'll often see functions created to handle different response types. For example, the parseJSON
function in this Workspace snapshot.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Crystal Vesely
14,503 Points2 Answers
-
yazeed asaad
8,400 Points1 Answer
-
mark lefler
2,662 Points1 Answer
-
jeni josi
61 Points1 Answer
-
Mitchell Wintrow
4,380 Points2 Answers
-
Johan Berglund
4,968 Points2 Answers
-
Paul Brubaker
14,290 Points1 Answer
-
Taylor Hall
Front End Web Development Techdegree Graduate 14,496 Points2 Answers
-
Janelle Mackenzie
7,510 Points2 Answers
-
Jerome vanGaalen
18,941 Points1 Answer
-
Joseff Kitchen
Front End Web Development Techdegree Graduate 16,751 Points1 Answer
-
PLUS
Jonathan Ambriz
Courses Plus Student 3,902 Points1 Answer
-
PLUS
Jonathan Ambriz
Courses Plus Student 3,902 Points1 Answer
-
Joanna Suau
3,754 Points2 Answers
-
Joseph Michelini
Python Development Techdegree Graduate 18,692 Points1 Answer
-
PLUS
Begana Choi
Courses Plus Student 13,126 Points2 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
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