replaced http.createClient (deprecated) with http.request