-- make a common methos for http connections