Hello everybody,
I’m trying to upload image in Android Device but always returns “Network Request Failed”.
the same code works perfect on iOS.
This is the snippet:
let formData = new FormData();
formData.append("photo", {
name: "photo.jpg",
type: "jpg",
uri: photo.uri.replace("file://", "")
});
formData.append("word", word);
formData.append("language", "pt");
formData.append("device_id", device_id);
const options = {
method: "POST",
headers: {
Accept: "application/json",
Authorization: `Bearer ${token}`,
"Content-Type": "multipart/form-data"
},
body: formData
};
let response = await fetch(`${URL_API}/security/create`, options);
let result = await response.json();
what’s wrong ?
i’m using Expo SDK 32.0.0