Skip to content
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 as argument in send method #43

Open
chetandhembre opened this issue Oct 3, 2012 · 3 comments · May be fixed by #81
Open

FormData as argument in send method #43

chetandhembre opened this issue Oct 3, 2012 · 3 comments · May be fixed by #81

Comments

@chetandhembre
Copy link

today i try to call xmlhttprequest during that i send argument of type FormData but it is giving error as follow:

TypeError: Argument must be a string

@driverdan
Copy link
Owner

FormData is part of the XHR 2 spec which node-XHR is missing most of, including FormData. This is something I'd like to add when I have a chance.

Take a look at @felixge's FormData lib for node: https://github.com/felixge/node-form-data

@Jeff-Meadows
Copy link

I got this working with some hacking earlier and I'd be happy to submit a PR. In my mind, this can be done by adding node-form-data as a dependency and checking if send has been called with an instance of FormData, or by just checking data for getHeaders, pipe, and getLengthSync (and assuming objects with those properties should be treated as a FormData).

Let me know which you'd prefer.

@Jeff-Meadows Jeff-Meadows linked a pull request Jul 23, 2014 that will close this issue
@jacwright
Copy link
Contributor

👍 I was about to create this PR. Glad I checked first! This is the solution I was going to do as well. Please accept @driverdan. We need file-upload capability in our client/server SDK and this is a great solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants