title: how to send text using HttpWebRequest class in C#
body: <p>I have this function in C# witch is called via a timer every 1 minute...</p>
  
  <pre><code>private void timer1_Tick(object sender, EventArgs e)
  
  {
      string strServer = "hhttp://www.mydomain.net/save.php";
      try {
          HttpWebRequest reqFP = (HttpWebRequest)HttpWebRequest.Create(strServer);
          HttpWebResponse rspFP = (HttpWebResponse)reqFP.GetResponse();
          if (rspFP.StatusCode == HttpStatusCode.OK) { // ther is an internet connection
              //send the text stored in 'writeUp' string variable to the url via 'POST' methode
              rspFP.Close(); //is good to open and close the connection every minute
          }
      }
      catch (WebException) {
          //I don't know why to use try/catch... but I just don't want any errors to be poped up...
      }
      writeUp = "";
  }
  </code></pre>
  
  <p>this code is written to do the next:</p>
  
  <p>check if there's a connection to the site...<br>
  if there's a one, then... send the text from the 'writeup' string variable to the 'save.php' file stored in the root of the site...<br>
  where the writeup string will be posted to the php file using 'POST' method (instead of 'Get' method)...<br>
  so I can accept the text in PHP via the variable $_POST['writeup']<br>
  so i can then process the text as I want...  </p>
  
  <p>more questions...
  witch better open and close the httprequest every minute... or keep it open all the time the internet connection is available...</p>