Member-only story
In my previous article, “Deep Insights Into JavaScript’s Fetch API”, I discussed the basics of the Fetch API. But it’s worth acknowledging thatfetch()
isn’t consistently an ideal solution, and there are sometimes better alternatives for making HTTP requests. Here I’ll describe why Axios is better thanfetch()
in development. This is my 36th Medium article.
Fetch()
is part of a JavaScript window-object method within the Fetch API. It is built in, so users don’t have to install it.Fetch()
allows us to get data from the API asynchronously without installing any additional libraries.
The above piece of code is a simplefetch()
get request. In thefetch()
method, there’s one mandatory argument, which isurl
.url
is a path from which the user would like to get data. Thenfetch()
method returns a promise…
Software Engineer 👨💻 @SyscoLABSSL | Postgard🧑🎓 in CSE at UOM | Technical Writer ✍️ |sabesansathananthan.now.sh | Still makes silly mistakes daily.