Ejemplo n.º 1
0
        static void RepeatWithDigestOnFail(IOConnectionInfo ioc, DoWithRequest f)
        {
            WebRequest req = CreateWebRequest(ioc, false);

            try{
                f(req);
            }
            catch (WebException ex)
            {
                if ((ex.Response is HttpWebResponse) && (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.Unauthorized))
                {
                    req = CreateWebRequest(ioc, true);
                    f(req);
                }
                else
                {
                    throw;
                }
            }
        }
Ejemplo n.º 2
0
 static void RepeatWithDigestOnFail(IOConnectionInfo ioc, DoWithRequest f)
 {
     WebRequest req = CreateWebRequest(ioc, false);
     try{
         f(req);
     }
     catch (WebException ex)
     {
         if ((ex.Response is HttpWebResponse) && (((HttpWebResponse) ex.Response).StatusCode == HttpStatusCode.Unauthorized))
         {
             req = CreateWebRequest(ioc, true);
             f(req);
         }
         else throw;
     }
 }