Use request instead of http.createClient. Add error handling in case of bad response.