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.