Eg: By referencing an encoder function using the standard on* attribute. Could be called onbeforesubmit=encodeMsgpack. This function would take a JS object, generated according to the W3C's JSON form spec, and return a pair of [string, arraybuffer]. String being the MIME content type, and arraybuffer containing the request body.
Re:W3C HTML JSON form submission
by icebraining on Thursday November 27, 2014 @02:15PM
(#8668503)
If you're going to run custom JS code, why not simply submit it through JS HTTP requests? What have you gained by this new API?
This proposal allows regular HTML forms with multiple input elements, but submitting over JSON. I can't see how you could define that for arbitrary encodings without first defining how the form fields map to the encoded data for all the encodings you'd want to support.