public static async Task <User> VerifyCredentials(NetworkCredential credentials) { HttpWebResponse response = null; User User = new User(); try { response = await SendHttpWebGETRequest(credentials, MAL_API_URL + "account/verify_credentials.xml", ContentType.XML); if (EnsureStatusCode(response)) { StreamReader responseStream = new StreamReader(response.GetResponseStream()); User = XMLConverter.DeserializeXmlAsStringToClass <User>(responseStream.ReadToEnd()); User.Credentials = credentials; } } catch (WebException ex) { Debug.Write("WebException response: " + ex.Status); } finally { if (response != null) { response.Dispose(); } } return(User); }