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

Move from axios to undici as http client #2488

Closed
nazarkulyk opened this issue May 19, 2022 · 7 comments
Closed

Move from axios to undici as http client #2488

nazarkulyk opened this issue May 19, 2022 · 7 comments
Labels
feature request Requests for new functionality wontfix This will not be worked on

Comments

@nazarkulyk
Copy link

Currently axios is used as http client abstraction layer.
Much better, standard way would be to use request or fetch way to work over http layer.
Some standards like
https://fetch.spec.whatwg.org/
and
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

So, maybe simple move from axios to uncidi would be good alternative.

https://www.npmjs.com/package/undici

https://undici.nodejs.org/#/

@nazarkulyk nazarkulyk added the feature request Requests for new functionality label May 19, 2022
@marikaner
Copy link
Contributor

marikaner commented May 20, 2022

@nazarkulyk That is an interesting idea, thank you for the suggestion. We will talk about it. Can you specify what this would make better for you? Do you have any issues with the current implementation, that you hope to improve with that?

@nazarkulyk
Copy link
Author

@marikaner undici is developed directly by nodejs dev team. Undici implements standard API, that means you can easy switch this layer to any standard one, specially if you want to go to other platforms. Undici gives you more performance and better HTTP protocol support.

@FrankEssenberger
Copy link
Contributor

@marikaner when you have a look keep the boundary condition in mind, that we need to configure proxies which we currently do by handing in the httpProxyAgent instead of the normal httpAgent from node. Same is true for all the trust related certificate things. So these two things need to be supported.

@FrankEssenberger
Copy link
Contributor

FrankEssenberger commented May 20, 2022

First google hit suggests that you can also pass a custom agent in node fetch. So this should be fine. I would prefer native support though, since our current agent is not so active with support. We have a issue with proxy and client side certificate authentication which was not working and not fixed

@nazarkulyk
Copy link
Author

I think that undici is still better choice than node-fetch anyway... 🍡

@nocin
Copy link

nocin commented Jun 8, 2022

I would also support this idea, as axios makes problems when using formData (2450).

@marikaner marikaner added the wontfix This will not be worked on label Jul 18, 2022
@marikaner
Copy link
Contributor

@nazarkulyk @nocin Thank you for this suggestion. I created a low priority issue in our backlog to consider such a change in one of our future major version releases. It is not likely that this will happen soon and I currently don't see a good reason to switch.
If this affects you in any way, please let me know, we will reconsider then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new functionality wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants