title: Multiple POST using WebRequest
body: <p>I am able to send the first request working fine, however I can't get my head round why it stalls on getting the <code>Stream os = smsRequest.GetRequestStream()</code> the second time.</p>
  
  <p>I am aware that you can't write to a Request more than once that is why a new instance is created each time.</p>
  
  <pre><code>    public void SendSMS(Dictionary&lt;double, IList&lt;string&gt;&gt; texts)
      {
          if (CreateWebRequest())
          {
              foreach (double mpn in texts.Keys)
              {
                  foreach (string sms in texts[mpn])
                  {
                      string formParams = string.Format("sendTo=0{0}&amp;selectText=Please+Select...&amp;textMessage={1}&amp;x=28&amp;y=10", mpn, sms);
                      byte[] encodedParams = Encoding.UTF8.GetBytes(formParams);
  
                      HttpWebRequest smsRequest = CreateSMSRequest(encodedParams);
  
                      using (Stream os = smsRequest.GetRequestStream())
                      {
                          os.Write(encodedParams, 0, encodedParams.Length);
                          os.Close();
                      }
                  }
              }
          }
      }
  
  
      private HttpWebRequest CreateSMSRequest(byte[] encodedParams)
      {
          HttpWebRequest smsRequest = (HttpWebRequest)WebRequest.Create(PostUrl);
          smsRequest.Method = WebRequestMethods.Http.Post;
          smsRequest.ContentType = "application/x-www-form-urlencoded";
          smsRequest.ContentLength = encodedParams.Length;
          smsRequest.AllowAutoRedirect = false;
          smsRequest.Credentials = CredentialCache.DefaultNetworkCredentials;
          smsRequest.Headers.Add(HttpRequestHeader.Cookie, _cookieData);
  
          return smsRequest;
      }
  </code></pre>