partially modularized portions of http-transport