Reputation: 635
How to skip ssl verification?
fetch('url',{ methhod: 'GET', header:{Accept:'application/json',}})
.then(res=>console.log(res))
Upvotes: 0
Views: 791
Reputation: 3426
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);
}
Upvotes: 0
Reputation: 635
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));
Upvotes: 1