简体   繁体   English

与NodeJS中内置的HTTP客户端相比,使用axios有什么优势?

[英]What are the advantages of using axios over the built in http client in NodeJS?

NodeJS has a built in package for making http requests. NodeJS有一个用于发出http请求的内置程序包。 The package seems to be easy to use and makes it easy to handle asynchronous responses via callbacks. 该程序包似乎易于使用,并易于通过回调处理异步响应。 Still I see everyone using third party http packages like axios . 我仍然看到每个人都使用axios类的第三方http软件包。

What are the advantages of using axios compared to the built in http package? 与内置的http包相比,使用axios有什么优势?

Well, Axios is a well known open source package (MIT licensing), this means it has the whole community finding issues and fixing it. 好吧,Axios是一个著名的开源软件包(MIT许可),这意味着它有整个社区来寻找问题并加以解决。 It gets over 400K downloads for week an is ready to use. 一周即可下载超过40万次,随时可以使用。 If you build one your self you would have to take the time to built it, test it and would have only your self and the team involved in the development to maintain, even if you make it open source, it wold take time to get all issue and etc. 如果您要构建自己的自我,则必须花一些时间来构建它,对其进行测试,并且只有您自己和参与开发的团队才能维护,即使您将其开源,也要花费很多时间才能获得全部问题等

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM