I need to submit a form and include some custom http headers with the request (the API requires them).
Something like jQuery.ajax() works great (https://api.jquery.com/jQuery.ajax/), I can use the beforeSend arg to compose some headers.
However I need this for a synchronous request, to direct the browser to the destination of the form. So one of the following two would work, but I'm not sure if a solution exists.
Have JS create and submit a form. How do I include custom http headers in a form?
Find an equivalent function to jQuery.ajax(), that will submit a synchronous request.