I've used this excellent answer and netcat to see what comes through when a form is submitted. That example works great, however, on my own form something is preventing all of my form data from going through. After my first six inputs come through, everything else stops. I'm wondering, what is causing the form to seemingly randomly stop sending data partway through?
If it matters, the form does have some textarea inputs and a multiple file input that don't get sent, but there are also some regular checkboxes that don't come through, and some that do.
Netcat output:
POST / HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Content-Length: 890
Pragma: no-cache
Cache-Control: no-cache
Upgrade-Insecure-Requests: 1
Origin: null
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryAyNkJk1235KNtl3
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/536.55 (KHTML, like Gecko) Chrome/65.0.3326.184 Safari/536.55
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
... (List is shortened)
------WebKitFormBoundaryAyNkJk1235KNtl3
Content-Disposition: form-data; name="someData"
false
------WebKitFormBoundaryAyNkJk1235KNtl3
Content-Disposition: form-data; name="someMoreData"
true
------WebKitFormBoundaryAyNkJk1235KNtl3--
Some stuff that doesn't come through the POST:
...
<label>High Priority <input type="checkbox" id="priorityCheckbox" name='priority'></label>
<textarea id='instructions' name='instructions'></textarea>
<h3>Attach files:</h3>
<input type="file" id="fileUpload" name="file" multiple />
<button type="submit" form="requestForm" class='btnSuccess' id="btnSubmit">Submit</button>
</form>
Turns out my <form>
was incorrectly straddling divs, like:
<div>
<form>
</div>
</form>
Anything after the closing div
containing the opening form
element was lost in the POST.