Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React-Native expo POST Blob

$
0
0

I'm using react native with expo and I'm trying to POST a blob image through fetch api. I'm using form-data format for the body and i have the next code:

       const blob = await response.blob()       const form = new FormData()        form.append('file', blob)        const options: RequestInit = {            method: 'POST',            headers,            body: form        }        return this.fetch(path, options).then(res => {            console.log("FETCHING", res.status)            this.processResponse(path, options, res)        }).catch(err => {            console.log("FETCH ERROR", err)        })

Response never happens, and my console says "FETCH ERROR [TypeError: Network request failed]". Any idea?

Thanx from before hand


Viewing all articles
Browse latest Browse all 6287

Trending Articles