axios原理深入源码解析

2019-11-26

axios


axios的github地址上明确写了axios的特征是
Make XMLHttpRequests from the browser(从浏览器发起XMLHttpRequests请求)
Make http requests from node.js(从node.js发起http请求)
Supports the Promise API(支持PromiseAPI)
Intercept request and response(拦截请求和响应)
Transform request and response data(转换请求和响应数据)
Cancel requests(取消请求)
Automatic transforms for JSON data(自动转换json数据)
Client side support for protecting against XSRF(客户端支持自动防止XSRF)
下面就这些特征查看源码来解析