Challenge: Work with Third-Party Libraries
Task
You're building a detailed breed information display. After fetching breed data from the API, you'll display each breed's name, description, life span, male and female weight ranges, and hypoallergenic status.
- Use Axios to fetch data from the
https://dogapi.dog/api/v2/breeds
when the "Fetch Breeds" button is clicked, wrapping the request in a try-catch block. - If there's an error during the API request, hide the loading indicator and display an error message.
index.html
index.css
index.js
- Use
axios.get('https://dogapi.dog/api/v2/breeds')
to fetch data from the API; - In the
catch
block, handle the error.
index.html
index.css
index.js
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 4. Capítulo 9
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Awesome!
Completion rate improved to 2.22
Challenge: Work with Third-Party Libraries
Deslize para mostrar o menu
Task
You're building a detailed breed information display. After fetching breed data from the API, you'll display each breed's name, description, life span, male and female weight ranges, and hypoallergenic status.
- Use Axios to fetch data from the
https://dogapi.dog/api/v2/breeds
when the "Fetch Breeds" button is clicked, wrapping the request in a try-catch block. - If there's an error during the API request, hide the loading indicator and display an error message.
index.html
index.css
index.js
- Use
axios.get('https://dogapi.dog/api/v2/breeds')
to fetch data from the API; - In the
catch
block, handle the error.
index.html
index.css
index.js
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 4. Capítulo 9