umi-request
umi-request copied to clipboard
[Question] why {...res} always get {} even if res is a validate Response
I put the following configuration in app.tsx, console always output {} which I expect extending response data with my customize data, but it doesn't work. What should I do to extend response data? And why does this happen?
export const request: RequestConfig = {
responseInterceptors: [
(res: Response) => {
console.log(res.status); // this line can get the right http status
console.log({...res}); // this line will always output {}
return res;
},
],
};
@clock157 @yesmeck @yutingzhao1991
hello, anyone can help?