Boilerplate for managing the http connection.