@Adel-Harrat
Posted
Hello and congratulations on completing this challenge! 🎉
I did sent the request api like this:
// Fetching the random advice data
fetch(https://api.adviceslip.com/advice?t=${Math.random()}
)
By appending ?t=${Math.random()} to the API URL, you add a random query parameter, which helps bypass any caching mechanisms on the server side. This ensures that each request is treated as unique, and you receive new advice every time you click the dice button.
Marked as helpful