admin管理员组文章数量:1415684
This is the error i am getting : -
Below is the code : -
const login = async () => {
console.log("running....")
try {
console.log("try block")
const response = await fetch(";, {
method: 'POST',
headers:
{
Accept : "application/json",
'Content-Type': 'application/json'
},
body: JSON.stringify({ email: "[email protected]", }),
});
console.log("Response Status:", response.status);
const jsonResponse = await response.json();
console.log("Response:", jsonResponse);
} catch (error) {
console.error("Error:", error);
}
};
also set the file (network_security_config.xml)
`<!-- react native -->
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">;/domain>
</domain-config>
<!-- <base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config> -->
</network-security-config>`
AndroidMAnifest.xml
So i have tried
- changes AndroidMAnifest.xml (check above image)
- postman working fine
- other api is working
Above is dummy api but the problem is other apis i am able to get response just the main api not working.
本文标签: Not able to hit api in React Native only in Android (IOSPostman Working)Stack Overflow
版权声明:本文标题:Not able to hit api in React Native only in Android (IOS , Postman Working) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745239078a2649214.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论