I am uploading an image to a server, imageUri is taken via expo's ImagePicker, here is the code:
const formData = new FormData()
formData.append('picture', { uri: imageUri, name: filename, type })
await fetch(uploadProfileImageURL, {
method: 'POST',
body: formData,
header: {
Accept: 'application/json',
'Content-Type': 'multipart/form-data'
}
})
On android it works like a charm, but on iOS devices its random, 50% of time it works, and the rest time it gives iOS network error:
"Error processing request body: Error Domain=ABI25_0_RCTErrorDomainCode=0 "Invalid request Token." UserInfo={NSLocalizedDescription=Invalid request token.}"
Upgrading expo version to latest one by that time fixed the issue. Also some users experienced same problems when using expo-pixi. Again, upgrading the version of expo-pixi solves it.