I sloved the problem with installing rn-fetch-blob library and bypass ssl certificate
RNFetchBlob.config({ trusty: true })
.fetch(
'POST',
'https://yourAPI',
{
'Content-Type': 'application/json',
},
dataObj
)
.then(res => console.log(res));
If you trying to make a GET request there is no need to pass the method and header info.
let apiUrl = "https://url/"
fetch(apiUrl)
.then((response) => response.json())
.then((jsonData=>{
console.log(jsonData);
})
.catch((err)=>{
console.log("err",err);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.