apisauce
apisauce copied to clipboard
Upload image not working on 3.0.1
Below is the code,
const form = new FormData()
form.append('image', {
name: imageFileName,
type: imageType,// image/jpeg
uri: Platform.OS === 'ios' ? imageFilePath.replace('file://', '') : imageFilePath,
})
const result = await userInfo.updateUserImage(form)
This fails to work on version 3.0.1 with http error code 400 bad request but the same works on version 2.1.6. I did checked for logs in addAsyncRequestTransform method. For both version 2.1.6 as well as 3.0.1 the request json formed is same but the image gets uploaded successfully on version 2.1.6 and fails on 3.0.1 with http error code 400 bad request.