I am not entirely sure I understand your question.

The basic idea is:
* if a properties map is passed in to the post function (that is the input is not null and its size is not 0), use OutputStreamWriter to open the connection (call HttpURLConnection#connect()) and write the body of the HTTP POST request. When the data is written and the request has been sent and the response received, use IOUtils.closeQuietly(writer) to call close on the OutputStreamWriter writer object.
* otherwise, no body is necessary for the HTTP POST request, then call conn.connect() to send it and receive the response.