title: Silverlight HTTP POST
body: <p>I am just trying to perform an http post on <a href="http://www.test.com/test.asp?test1=3" rel="nofollow noreferrer">http://www.test.com/test.asp?test1=3</a>.  Here is the code I have been trying to use:</p>
  
  <pre><code>    private void pif_test_conn()
      {
  
  
          Uri url = new Uri("http://www.test.com/test.asp?test1=3", UriKind.Absolute);
  
  
  
          if (httpResult == true)
          {
  
  
              HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
              request.ContentType = "application/x-www-form-urlencoded";
              request.Method = "POST";
             request.BeginGetResponse(new AsyncCallback(ReadCallback), request); 
  
          }
  
  
  
          return ;
      }
  
  
     private void ReadCallback(IAsyncResult asynchronousResult)
      {
  
  
          HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState;
  
  
          HttpWebResponse response =  (HttpWebResponse)request.EndGetResponse(asynchronousResult);
  
          using (StreamReader streamReader1 =  new StreamReader(response.GetResponseStream()))
          {
  
              string resultString = streamReader1.ReadToEnd();
  
               MessageBox.Show("Using HttpWebRequest: " + resultString, "Found", MessageBoxButton.OK);             
          }
  
      }
  </code></pre>
  
  <p>When I execute this code my program triggers the Application_UnhandledException event.  Not sure what I am doing wrong. </p>