我遇到了以下错误.
fetch("https://XXreachable-domainXX.de/api/test", {
method: "post",
body: JSON.stringify({
param: 'param',
param1: 'param',
})
}
)
.then((response) = > response.json()
)
.
then((responseData) = > {
ToastAndroid.show(
"Response Body -> " + JSON.stringify(responseData.message), ToastAndroid.SHORT
)
})
.
catch((error) = > {
console.warn(error);
})
;
应用程序现在抛出一个错误:
类型错误:网络请求失败
当我将代码更改为GET请求时,它可以在带有窗口的浏览器中正常工作.alert()作为返回,它很酷,而且chrome扩展postman 也能正确返回数据.