Support for HTTP POST

Added support for HTTP POST.
Refactored HTTP functions to use common methods for initialization, response and termination.