I am using react native to make a chat-like app. Postman is working properly while doing all the requests I made possible in .NET core API, but when I am trying to fetch from react native it gives the following error:
"null is not an object (evaluating 'blob.data')"
I have tried to look into this issue in different articles but haven't found anything.
return new Promise((resolve, reject) => {
fetch('https://localhost:44305/api/replies', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(qId)
})
.then(res => res.json())
.then(result => resolve(result))
.catch(err => reject(err))
})
I am trying to get a list of answers to a question. Doing it from Postman works fine. I can't find a solution for this error.
I have tried adding return, just like somebody mentioned in a comment before fetch. The result is the same..