update hostname/port for request and add unit test