title: Check m3u8 web url with C#
body: <p>I'm doing a little function inside a program, and I'll like to check if a m3u8 link is working. However, I'm not able to do it correctly, because some links are not working, but they are returning a status code equals to OK. Here you have my code:</p>
  
  <pre><code>var textBox     = (TextBox)this.FindName("urlToCheck");
  var request     = (HttpWebRequest)WebRequest.Create(textBox.Text.Trim());
  request.Method  = "HEAD";
  
  try
  {
      var response = (HttpWebResponse)request.GetResponse();
      var success  = response.StatusCode == HttpStatusCode.OK;
  
      if (success) MessageBox.Show("Apparently the link is working");
      else MessageBox.Show("Apparently the link is not working");
  }
  catch (Exception)
  {
      MessageBox.Show("Tthe link is not working");
  }
  </code></pre>
  
  <p>How can I detect if there is real stream inside the working links? I'm not sure how to do it, how to detect a working URL Stream and one that not. The only way now for me, is by using the VLC Player.</p>
  
  <p>Lot of thanks for your help.</p>
  
  <p>Best regards</p>