2022-10-04 axios发布了1.0.0版本 来看看都更新了什么 我记得我学前端开始的时候 axios就一直是0.2x.xx 没想到第一个大版本来的这么快
- 尝试在创建错误时捕获堆栈跟踪,以便维护关于错误来源的上下文。
在发生错误时可以获得更多的信息
- 添加了AxiosError类
// Expose AxiosError class | |
axios.AxiosError = require('../lib/core/AxiosError');
- 使用Rollup构建
- 清楚堆栈中的所有拦截器
InterceptorManager.prototype.clear = function clear() {
if (this.handlers) {
this.handlers = null;
}
};
- axios-url-template - Axios interceptor adding support for URL templates.
- @react-cmpt/react-request-hook - A React hook plugin for axios. Lightweight and less change.
- Add 2 new options to AxiosRequestConfig:
transformSuccessResponse: 仅为成功响应转换响应数据。 transformErrorResponse: 仅为错误响应转换响应数据。
- 添加blob到浏览器支持的协议列表