adds code for the used openHttpConnection method