React-native fetch Api 调试模式和普通模式获取响应不同

React-native fetch Api get response differs from debugging mode and normal mode

我尝试使用 Axios 方法调用 https 请求获取方法 API,它从服务器响应 200,但在服务器端,API 未命中。不知道响应来自哪里,同样的 API 我曾尝试使用 post-man,我得到了 200 状态并正确更新了响应。之后我开始使用 react-native-debugger 来调试响应,我用网络检查器进行了调试,并且我尝试了相同的 API,它得到了 200 的正确响应。这会是什么问题。谁帮我找出这个错误。

我使用 fetch 添加了下面的代码,同样的情况也发生在 Axios 调用中。在 react-native-debugger 中启用网络检查器时还发现了一件事 API 工作得很好。

fetch(requestUrl, {
       method: methods.get,
       headers: head,
     })
       .then(response => response.json())
       .then(responseJson => {
         console.log('res JSON', responseJson);
           alert('your todolist is completed!!');
        }
       })
       .catch(error => {
         console.error(error);
       });

在上面link找到了这个问题的答案,它在axios中存储了一个缓存或者自己fetch。不是它完美地工作。谢谢大家