Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axios Instead of Node.js Built-in Fetch for HTTP Requests #10

Closed
darkknight13 opened this issue Apr 26, 2024 · 0 comments · Fixed by #15
Closed

Axios Instead of Node.js Built-in Fetch for HTTP Requests #10

darkknight13 opened this issue Apr 26, 2024 · 0 comments · Fixed by #15
Assignees
Labels
enhancement New feature or request

Comments

@darkknight13
Copy link
Contributor

The cql-test-runner currently relies on the built-in Fetch API for managing HTTP requests. While Fetch is a competent tool, it's worth exploring the potential benefits of transitioning to Axios for several reasons.

  1. Ease of Use and Syntax: Axios boasts a simpler and more intuitive syntax in comparison to Fetch. With Axios, handling HTTP requests and managing responses can be accomplished with fewer lines of code and reduced boilerplate.

  2. Automatic JSON Parsing: Axios automatically parses JSON responses, eliminating the need for manual parsing methods like .json() required by Fetch.

  3. Error Handling: Axios streamlines error handling by providing built-in support for managing common HTTP errors. This results in a more straightforward and robust error-handling process compared to Fetch. Axios, by default, throws errors for non-200 status codes.

  4. Progress Tracking: Axios offers built-in functionality for tracking upload and download progress. This feature can be particularly useful for monitoring file uploads or downloads within the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants