convert request() to a promise