Log [Typeerror: Network Request Failed] React Native

I've been trying to fetch data from Django , so I can create a react native app, I wrote the same method using useEffect,and it worked with me when I created web app, and now when I use it with react native, I still got [TypeError :Network request failed ], is it because the Token?

useEffect(()=>{
    fetch('
        method:'GET',
        headers:{
            'Authorization':`Token f4136c8a15e73530edf6660d0062813362f6a02b`,
        }
    }).then(resp=>resp.json())
    .then(resp=>console.log(resp))
    .catch(error=>console.log(error))
},[])
1
Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article