public void Remove(Uri uriPrefix, string authType) { if (uriPrefix==null || authType==null) { // these couldn't possibly have been inserted into // the cache because of the test in Add() return; } ++m_version; CredentialKey key = new CredentialKey(uriPrefix, authType); GlobalLog.Print("CredentialCache::Remove() Removing key:[" + key.ToString() + "]"); if (cache[key] is SystemNetworkCredential) { --m_NumbDefaultCredInCache; } cache.Remove(key); }
public static void Init(string apiKey, string apiUrl) { _apiUrl = apiUrl; if (!_apiUrl.EndsWith("/")) { _apiUrl += "/"; } _cc = new CredentialCache(); var url = new Uri(_apiUrl); _cc.Remove(url, "Basic"); _cc.Add(url, "Basic", new NetworkCredential("api_key", apiKey)); }