Add the option to use FormData to encode the form elements #153
Reference in New Issue
Block a user
Delete Branch "feature/form-data"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If the form's
enctypeattribute is set tomultipart/form-data, useFormDatato encode the form's elements.Fixes #132.
@@ -34,0 +45,4 @@function parseFormElements(el) {var requestParams = []You can remove
requestParams: []from line 19 now, as this makes that initialisation redundant.You should either add
var formData = requestOptions. formData || nullon line 9 to match the correspondingrequestParamsvariable we use in this module, and then replace all other instances ofrequestOptions.formDatawithformDataor removevar requestParams = requestOptions.requestParams || nullfrom line 8 and replace all instances ofrequestParamswithrequestOptions.requestParams.I think you'll also need to update your TypeScript definitions as part of this, is that correct?
Good point.
@@ -34,0 +45,4 @@function parseFormElements(el) {var requestParams = []Fixed.
Thanks for actioning my feedback, LGTM 👍
It's great to have a second pair of eyes on it. There's always something that I miss. So thanks for that.
Nice one on getting this feature in there, I think it's probably time we pushed out a new version now!
I'm going to start working on that.
Great, let me know if there's anything I can do to help.