replaced the deprecated method http.createClient for http.request