creating intermedoate buffer in http connection