Construct the URL.
Call the URL's openConnection()
method to create the
URLConnection
object.
Pass true
to the URLConnection
's setDoOutput()
method
Create the data you want to send, preferably as a byte array.
Call getOutputStream()
to get an output stream object.
Write the byte array calculated in step 5 onto the stream.
Close the output stream.
Call getInputStream()
to get an input stream object. Read from it as usual.