-
Notifications
You must be signed in to change notification settings - Fork 6
Add RequestBody.fromFormData
#12
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
Comments
I'd probably add a |
Looks like we might want to extract it into a contrib repo or something after all, since (There may also be some other aspects of this library or |
I've been pondering this yet again... It's true that It is true that some of the interface bindings that are provided won't work in node, but I'm not sure how much that really matters? It's arguable that not all of the API exposed by these libraries work in all browser situations either. The most correct way to resolve this would probably be through some kind of capability-availability-providing mechanism (a typeclass I guess) to help document/enforce exactly which features are available in what situations, but that's perhaps overkill. |
One thing to keep in mind is that afaik the xhr on node requires a node dependency (xhr2, which is btw not maintained anymore). This is really a pain in SSR frameworks like nextjs. Since you suddenly need a node dependency which theoretically ends up in your front end code. This was also the original motivation to write |
Using I just did a quick test to confirm: module Main where
import Prelude
import Debug (traceM)
import Effect (Effect)
import Web.XHR.FormData as FormData
main :: Effect Unit
main = do
fd <- FormData.new
traceM fd
|
Hi,
As usual - thanks for providing and maintaining this lib!
fetch
supportsFormData
as a payload:https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#uploading_a_file
I can provide a PR but it requires additional decision -
FormData
is a part ofpurescript-web/purescript-web-xhr
:purescript-web/purescript-form-data
?web-xhr
?The text was updated successfully, but these errors were encountered: