From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Comparison and summary

Comparison and summary

Hello, and welcome back. In the previous video, we saw an example of using the API client, which we can define at one place. It can have the underlying library. In our case, it was Xeos, and we can just use that API client to make our request. That makes our code cleaner, reusable, and it also enhances that in future if we are changing the underlying layer or the underlying HTTP calling libraries. Now let's do a comparison of Fetch versus Axios once and for all. The built-in availability is in Fetch API, and it's not available in Axios. The automatic JSON capturing is not available in the Fetch API, but it's available in the Axios. The request interceptors are available only in Exeos. The timeout support is also available in Exeos only. The response parsing has to be done manually, whereas you can define a type with the Exeos get, post, and other HTTP methods, and it is going to infer the type automatically. Lastly, the error handling is also manual in the Fetch API, whereas Exios…

Contents