其他分享
首页 > 其他分享> > react native TypeError: Network request failed Unable to symbolicate stack trace: The stack is null

react native TypeError: Network request failed Unable to symbolicate stack trace: The stack is null

作者:互联网

TypeError: Network request failed

Unable to symbolicate stack trace: The stack is null

通过分析可以看出是网络请求问题。在react native 中,尝试fetch发送请求导致的问题。

关于fetch的代码:

fetch('http://localhost:8083/user/getAllUser', {
method: 'POST',
headers: {
"Accept": "application/json",
"Content-Type": 'application/json',
"Connection": "close",
"type": "getUserData",
},
mode : "cors",
body : JSON.stringify({
page : 1,
type :0
})
}) .then((response) => response.json())
.then((responseJson) => {
console.log(responseJson);
return responseJson.movies;
})
.catch((error) => {
console.error(error);
});
在测试过程中提示错误。
1. Android 端接收的http请求必须是ip 即访问地址必须是IP地址

 

 2. 请求头中必须包含一下内容

 

标签:responseJson,Network,fetch,json,TypeError,error,stack,请求
来源: https://www.cnblogs.com/youran-he/p/15761510.html