Saturday, January 21, 2012

How to write a multipart HTTP post request using simple HTML page

I found that it can be easily done in simple HTML page.


<html>
<body>
<form method="post" action="http://www.google.com" enctype="multipart/form-data">
<input type="text" name="mytext">
<input type="submit">
<input type="file" name="myfile">
</form>
</body>
</html>

Just write the above text and save the file as HTML file. Remember that the request itself will not work because GOOGLE will not support this post request, so change it so some valid URL. Here the enctype part enforce the content-type to be Multipart

No comments: