title: httpWebRequest Download and parse excel file?
body: <p>I am looking for a way to download an excel file from a url using httpWebRequest and parse it somehow - whether this means converting it to a .csv file so I can simply use <code>TextFieldParser</code> or leaving it as an excel file, I don't know.</p>
  
  <pre><code>private byte[] GetExcelFile()
          {
              var httpWebRequest = (HttpWebRequest)WebRequest.Create("url_To_Excel_File"); 
              httpWebRequest.ContentType = "application/vnd.ms-excel";
              httpWebRequest.Method = "GET";
  
              var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
  
              try
              {
  
                  using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
                  {
                      var contents = streamReader.ReadToEnd();
                      return contents;
                  }
  
              }
              catch (Exception ex)
              {
                  Console.WriteLine(ex.Message);
                  throw;
              }
           }
  </code></pre>
  
  <p>It is my understanding that <code>contents</code> should be an array of bytes? How can I correctly download this excel file and parse the response?</p>