const formData = new FormData();
for (let i = 0; i < image.length; i++) {
formData.append("postFile", image[i].data);
}
formData.append("imagesList", null);
console.log("formData..", formData)
rnfetchblob.fetch('POST', `${baseUrl}/fame/saveImage`, {
Authorization: `Bearer ${token}`,
otherHeader: "foo",
'Content-Type': 'multipart/form-data',
}, [
formData,
]).then((resp) => {
console.log("response = ", resp)
}).catch((err) => {
console.log("error = ", err)
})
I have tried too many times but the data is null i even spent full day on react native fetch blob documentation
Try with this function uploadImage
What changes have I made to this function, I change payload and use fetch instead of rnfetchblob.fetch