title: SharePoint 2007 Warmup Script (Alternative to Http Request)
body: <p>At the moment I am trying to HTTP response request in my Sharepoint WarmUp script, however for this, I will have to use this code</p>
  
  <pre><code> using (System.IO.StreamReader file = new System.IO.StreamReader(filePath))
                  while ((line = file.ReadLine()) != null)
                  {
                      try
                      {
                          WebRequest request = WebRequest.Create(line);
                          request.Proxy = null;
  
                          if ((userName == null) || (userName == ""))
                          {
                              request.Credentials = CredentialCache.DefaultCredentials;
                          }
                          else
                          {
                              CredentialCache myCache = new CredentialCache();
                              myCache.Add(new Uri(line), "NTLM", new NetworkCredential(userName, password, DomainName));
                              request.Credentials = myCache;
                          }
  
                          HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  
                          using (Stream dataStream = response.GetResponseStream())
                          using (StreamReader reader = new StreamReader(dataStream))
                          {
                              string responseFromServer = reader.ReadToEnd();
                              reader.Close();
                              dataStream.Close();
                              response.Close();
                          }
  
                          Thread.Sleep(2000);
                      }
  </code></pre>
  
  <p><strong>I am not suppose to use any User Account to get response, however I can use Default Credentials that only works when am logged in at server, otherwise they wont gonna work i guess.</strong></p>
  
  <p>Is there any other way of doing it, can't use powershell as its MOSS not sharepoint 2010</p>
  
  <p>cheers</p>