refactor http request.