Intento hacer la siguiente búsqueda con Android 12 API 28 nativo de reacción
(importar FormData desde 'form-data';)
let formData = new FormData(); const file = new File(["foo"], "foo.txt", "text/plain", ); let textFile = { uri: file.uri, name: "foo.txt", type: "text/plain" }; formData.append("photo", textFile); formData.append('description', 'helli'); fetch(url, { method: 'post', headers: formData.getHeaders, body: formData }).then(response => { console.log("image uploaded") }).catch(err => { console.log(err) })y Prueba con localhost (http) y heroku (https) pero no funciona
El error es: [TypeError: Network request failed]
el campo de descripción está bien pero el archivo aparece como nulo