Added implementation where server responses and closes connection to
HTTP POST query sending a message to a device depending whether the
message was sent successfully or not.