I need you help. For several days I have spent hours and hours trying, and looking for a solution but nothing.
I have to make a network request to use the TMDB API. So I do this (for example):
const url = 'https://api.themoviedb.org/3/movie/550?api_key=XXXXXXXXX'
console.log(url)
return fetch(url,{
method: 'GET',
headers: {
Accept: '*/*',
'Content-Type': 'application/json',
'accept-encoding': 'gzip, deflate, br'
}
})
.then((response) => {
console.log(response)
response.json()
})
.catch((error) => {
console.error(error)
})
.finally(() => {
console.log('fini')
})
But I never have response. I have try with fetch and Axios, but it's always the same: no response, no error, noting. The request works when I test it in my browser, it works on Postman and cURL, but not in my app.
For information I'm using an Android emulator, and I added android:usesCleartextTraffic="true" in the AndroidManifest file.
This is not my first React Native app and I never had this problem before.
Thank you in advance for taking the time to read me !
PS: I add a capture of the test made on jsfiddle.net and its equivalent on the android emulator.
--