Simplified code to use request instead of https.request. Request will follow redirects etc.