-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormData binding problem #37
Comments
Hmm, yeah the Any thoughts, @yawaramin, @anmonteiro? |
AFAIK |
In Chrome at least there are no issues with: var fd = new FormData()
var bl = new Blob()
fd.append('bl', bl, undefined) |
Unfortunatelly I cannot provide anything anymore because in the end I had to completely refactor the code and used the image in base64 instead of form data. It just didn't work with form data. |
No problem. As it turns out, we documented the issue with React Native in the interface file: https://github.com/reasonml-community/bs-fetch/blob/934389964e1005d4e37911c8324a6aeb7ce0a1b0/src/Fetch.mli#L260 . Maybe we should warn more explicitly there that it won't work in the browser. |
Thanks for the input @yawaramin. I forgot that this was only for React Native, and I'm not entirely sure why I accepted it. I don't think I would today. So I think there are a few different ways we could move forward on this:
I'm leaning towards 2. What do you guys think? |
Hello,
I tried the recently added FormData binding in a ReScript project exactly according to your example with appendObject and it doesn't work. The problem is that the JS snippet it generated looks like this:
The undefined as the third parameter is the problem. There must be no third parameter, not even undefined. If I remove it from the gerenated JS file, it works correctly.
If I understand the FormData API correctly the third parameter (filename) is used only for Blobs and Files.
The text was updated successfully, but these errors were encountered: