DEV Community

Discussion on: Short API GET using HTML, JS and Axios

gorlok profile image
gorlok ๐Ÿง‰ • Edited on

Why using Axios when you can use JS's fetch()? Short API GET? Use JS - It's even simpler and without any dependencies.

.then(resp => resp.json())
.then(data => => {
let p = document.createElement('p')
let a = document.createElement('a')
a.setAttribute('href', e.Link)
a.innerHTML = e.API

afpaiva profile image
Andre Paiva Author

Yes, you are right! It is really shorten.
But the idea of this post is to use Axios as short as I could. So that beginners in Axios, like me), can see how to start using it understanding the minimum usage of it. Like an entry point for study.
Great point, thanks for your comment!