updated to use HttpWebRequest instead of HttpClient