I am running a NodeJS fetch() in my React Native app to get data from my Flask Heroku server
This is what the Flask server does:
(I'm sure it returns this normally because when I go to the URL in my browser, it is a blank page with the word "false")
@app.route('/login')
def login():
#some code that I'm sure is working and doesn't need to be shown
return jsonify(False)
This is the code that the React Native app does:
console.log(address)
var returned = await fetch(address)
console.log(JSON.stringify(returned))
I know the address that it is using, since I'm printing it to the console. I have gone to this exact URL, copy-pasted from my console, in the browser and the data returned looks fine
Here is what the React Native fetch() returns:
{"type":"default","status":200,"ok":true,"headers":{"map":{"content-length":"6","connection":"keep-alive","content-type":"application/json","date":"Wed, 26 Aug 2020 17:46:31 GMT","via":"1.1 vegur","server":"gunicorn/20.0.4","cache-control":"public, max-age=0"}},"url":"[MY_URL_IS_HERE]/login?username=W&tag=L","bodyUsed":false,"_bodyInit":{"_data":{"size":6,"offset":0,"blobId":"e450e243-9a7e-4a35-8e47-f8e9f3c7a58c","__collector":{}}},"_bodyBlob":{"_data":{"size":6,"offset":0,"blobId":"e450e243-9a7e-4a35-8e47-f8e9f3c7a58c","__collector":{}}}}
I've looked at many guides and StackOverflow posts online, but none of them have helped me parse/get better data than this.
How do I get my data?
.json,.textetc, as mentioned in this link