The HTTP spec says that a POST request can contain an arbitrary body of data.
An HTML form
element can POST to a URL and may contain input
elements, but those input
elements get turned into a query string.
How can I get a form
to also send along data in the body of the HTTP POST request that it sends when its submit button is pressed?
Edit: While this question is quite happily independent of any other question, it is related to http://stackoverflow.com/questions/2925796/post-xml-to-server-receive-pdf
Somehow, I want to be able to send data in a POST's body, and I want the browser to automagically handle the HTTP response (which will be an application/pdf
). This question is phrased in such a way that I am hoping I can avoid using XmlHttpRequest (AJAX) and just use the browser's built-in behaviour with form
elements to properly submit data and handle the PDF that is sent back.