react-native-ssl-pinning
react-native-ssl-pinning copied to clipboard
Cannot POST formData with blob
Cannot POST formData with blob, receiving "ReadableNativeMap cannot be cast to java.lang.String" error (btw, such error with boolean values too)
const formData = new FormData()
formData.append('base64', base64) // image in string, base64
formData.append('image', image) // image as a Blob (bytes)
fetch(url, {
method: "POST" ,
body: {
formData,
},
sslPinning: {
certs: ["..."]
},
headers: {
'content-type': 'multipart/form-data; charset=UTF-8',
'accept': 'application/json, text/plain, /',
}
})

Hi @Desintegrator this happens because currently library supports only strings or file data in FormData like in the readme. will fix it