Just a heads up that if you’re submitting data via FormData with XHR2, you’ll need to ensure the proper Content-type header is set, otherwise request data won’t be sent properly. In my case, an incorrect Content-type header resulted in only sending FormData’s first attribute with the request.
Here’s some detail.
This was the form in question; Signal’s login form code, note the email and password fields:
Straightforward enough. But here’s what an XHR2 request looked like in Chrome’s Dev Tools:
Note that only the email value is being sent. Something is off.
Turns out the Content-type request header was set incorrectly. As shown above, it was set to application-x-www-form-urlencoded. Obviously that Content-type is incorrect given that we’re no longer sending request data via an encoded url, but rather as form data.
I had left the incorrect urlencoded header value in by acccident, but after removing it, all values from the login form are now sent as expected:
Hope this saves someone some time.