-
I want to convert an image from React Native to multipart/form-data format,
similar to image data from ReactJS: , -
To use with this API: https://rapidapi.com/iq.faceok/api/ocr-extract-text/playground/apiendpoint_112d8eae-cf70-4f29-bcb4-658edc3e9272.
-
I have tested it in Postman by selecting an image file, and it works fine.
Recognize text from image -
But in in react native, I use ImagePicker to select image:
image format
LOG {“assetId”: null, “base64”: null, “duration”: null, “exif”: null, “fileName”: “Screenshot_2024-05-28-22-32-39-36.jpg”, “fileSize”: 120545, “height”: 1600, “mimeType”: “image/jpeg”, “rotation”: null, “type”: “image”, “uri”: “file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540leopan%252FsepApp/ImagePicker/30bbc135-2c92-4026-9c9a-fc52c68aee6c.jpeg”, “width”: 720}
And it doesn’t work
I have watched many videos on YouTube and searched on Google; most people configure it in this way
convert to multipart file
But it still doesn’t work and only shows a network error.
If anyone has handled this case before, please help me.
park rose is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.