Added method for opening http connection.