axios的拦截器interceptor 与transformers的区别

An interceptor can be used to intercept the request/response at various points, as discussed above. But transformers can be applied just before sending a request or after receiving a response. Another important consideration is that, using transformers, you just get access to data and headers of request/response while interceptors have access to the config object.

翻译:拦截器可用于在不同点拦截请求/响应,如上文所述。但是,转换器可以应用在发送请求或收到响应之前。另一个重要的区别是使用transformers,您只能访问数据和请求/响应的头,而拦截器可以访问config对象。

发表评论

记录工作生活点滴。

返回
顶部