This is a nice and to the point (short) article, very useful for first timers who try to send data to server using HTTP POST method.
It clearly defines, how to set HTTP Connection as POST, how to set the Content-length, how to convert Query String to byte[] data and send it over Output Stream.
String strData = "name=" + game.getName() + "&score=" + game.getScore();
byte[] data = strData.getBytes();)
I have seen lot new developers straggling with HTTP Post trying how to send Query string to server which they were sending while working with GET, it will help them all.
thanks, ~Amitabh (im2amit)
Article is really short, it provides solution, but I have a question:
How to send array of data to the server? Author could explain how to construct string to be converted to bytes to be send - what is this "&" near the score, for example. --Warjan 21:57, 3 September 2009 (UTC)
Level: Intermediate
This article is used to write or read a data from web server through post request. It has HttpConnection class that has a URL as an argument. This URL is not just a link but it is a file that will have been written or read through OutputStream Object.
--Vkmunjpara 10:24, 19 September 2009 (UTC)