I need to be able to generate multipart-form data and to convert that to string to store it locally. For example, if I generate the form data as follows:
var form = new FormData();
form.append('part1', 'part 1 data');
form.append('part2', 'part 2 data');
I want to ask it to returns its rendering as a string (how it would get transmitted over web):
----------------------------900078007145468816304698
Content-Disposition: form-data; name="part1"
part 1 data
----------------------------900078007145468816304698
Content-Disposition: form-data; name="part2"
part 2 data
----------------------------900078007145468816304698--
Javascript is not exactly my strength, so hoping someone has a simple idea on how to do this.