-
Notifications
You must be signed in to change notification settings - Fork 78
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
Make it possible to provide FormData transparently #60
Comments
Absolutely, and this is an easy fix. I'll try to do this this week. For my own reference on checking for the FormData object type: https://codepen.io/pen/ |
Awesome. I added
to the param() function but that's no quit enough because of the default header
in case of a FormData it was best for me to let the request set the proper multipart content type and especially set the 'boundary' correctly so that the parameters arrived properly on the server. Side note: In my local atomic.js version I added support for 'timeout' settings via options like:
Just before the .send() |
I like that too! Great ideas! |
I added |
@cferdinandi Heya! Thanks for the lightweight library! I think this issue persists—there's no way to un-set the When using Would you be willing to revisit? I'm happy to issue a PR with this removed, but I'm weary that it would be breaking for others' uses. 😬 👋 |
@AugustMiller I'm maybe missing something, but... can't you update the |
Ordinarily, yeah—but the Speaking specifically about the latter half of this:
…which the browser sets automatically when Hope this makes sense? Edit: Thanks for the quick response! 💞 |
Ah, you actually need a way to "unset" items, then? |
I think so? I mean, this is probably the means to a backwards-compatible solution. 👍 In fiddling, I tried to unset by passing |
Yea, I'll need to add a new method to support this behavior. |
Hey,
I really like the simplicity of atomic.js. Yesterday I ran into a problem, though.
I want to upload a file via a FormData. However if I provide FormData to atomic.js (in contrast to just a simple object) it fails.
Would it be possible to enhance atomic.js so that if provided data is of type FormData atomic just passes it through to the xhr request?
The text was updated successfully, but these errors were encountered: