We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
第300天 axios为什么能在浏览器中环境运行又能在node中环境运行?
我也要出题
The text was updated successfully, but these errors were encountered:
源码中defaults.js文件里有getDefaultAdapter这个方法,用来判断环境。如果是浏览器就实例new XMLHttpRequest()来发送请求响应服务,node环境就引用http和https库处理和响应http服务。
Sorry, something went wrong.
axios的getDefaultAdapter函数可以判断当前环境,浏览器环境会require一个js文件,node环境会require另一个js文件,前者是用promise管控的xhr一套流程,后者是用node的http库发起http请求。
No branches or pull requests
第300天 axios为什么能在浏览器中环境运行又能在node中环境运行?
我也要出题
The text was updated successfully, but these errors were encountered: