title: "Post" XML Data like HTML with Hidden Values using ContentType ="txt/html"
body: <p>I want to do the same that works previously on HTML but now via .NET Windows Forms.</p>
  
  <p>When I submit this HTML it works :</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt; 
  &lt;form name="TestForm" action="http://staging.csatravelprotection.com/ws/policyrequest" method="POST"&gt;
  &lt;input type="hidden" name="xmlrequeststring" value=" 
  &lt;quoterequest&gt;
    &lt;aff&gt;COSTAMAR&lt;/aff&gt; &lt;!-- required --&gt;
    &lt;producer&gt;10527930&lt;/producer&gt; &lt;!-- optional --&gt;
    &lt;productclass&gt;85FL&lt;/productclass&gt;  &lt;!-- required --&gt;
    &lt;bookingreservno&gt;0123456789AB&lt;/bookingreservno&gt;  &lt;!-- optional --&gt;
    &lt;numinsured&gt;3&lt;/numinsured&gt;  &lt;!-- required --&gt;
    &lt;tripcost&gt;5000.00&lt;/tripcost&gt;  &lt;!-- required --&gt;
    &lt;departdate&gt;2010-11-01&lt;/departdate&gt;  &lt;!-- required --&gt;
    &lt;returndate&gt;2010-11-20&lt;/returndate&gt;  &lt;!-- required --&gt;
    &lt;triptype&gt;Cruise&lt;/triptype&gt; &lt;!-- optional --&gt;
    &lt;destination&gt;Europe/ Mediterranean&lt;/destination&gt;  &lt;!-- required --&gt;
    &lt;supplier&gt;Carnival Cruise Lines&lt;/supplier&gt;  &lt;!-- optional --&gt;
    &lt;airline&gt;American&lt;/airline&gt;  &lt;!-- optional--&gt;
    &lt;travelers&gt;
      &lt;traveler&gt;
        &lt;age&gt;45&lt;/age&gt;  &lt;!-- required --&gt;
      &lt;/traveler&gt;
      &lt;traveler&gt;
        &lt;age&gt;43&lt;/age&gt;  &lt;!-- required --&gt;
      &lt;/traveler&gt;
      &lt;traveler&gt;
        &lt;age&gt;15&lt;/age&gt;  &lt;!-- required --&gt;
      &lt;/traveler&gt;
    &lt;/travelers&gt;
  &lt;/quoterequest&gt; 
  "&gt;
  
  &lt;input type="submit" name="submit" value="submit"&gt;
  &lt;/form&gt; 
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>but when I try to send the XML via POST using .NET it appear to fail cause I dont know how to post via Hidden Input on the URI.</p>
  
  <pre><code>Imports System.IO
  Imports System.Text
  Imports System.Net
  Public Class Form2
      Private Shared URL As String = "http://staging.csatravelprotection.com/ws/policyrequest"
      Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          Dim oHttpWebRequest As WebRequest = WebRequest.Create(New Uri(URL))
          oHttpWebRequest.Method = "POST"
          oHttpWebRequest.ContentType = "text/xml"
          Dim oStream As Stream = oHttpWebRequest.GetRequestStream()
          Dim Reader As StreamReader = New StreamReader("C:\TEST.XML", Encoding.Default)
          Dim Postdata As String = String.Format("xmlrequeststring={0}", Reader.ReadToEnd)
          oStream.Write(Encoding.ASCII.GetBytes(Postdata), 0, Postdata.Length)
          oStream.Close()
          Dim oHttpWebResponse As HttpWebResponse = CType(oHttpWebRequest.GetResponse(), HttpWebResponse)
          Dim oStreamResponse As Stream = oHttpWebResponse.GetResponseStream()
          Dim oStreamRead As StreamReader = New StreamReader(oStreamResponse, Encoding.UTF8)
          Dim strReturnedXML As String = oStreamRead.ReadToEnd()
  
          MessageBox.Show(strReturnedXML)
          oStreamResponse.Close()
          oStreamRead.Close()
          oHttpWebResponse.Close()
      End Sub
  End Class
  </code></pre>
  
  <p>XML :</p>
  
  <pre><code>&lt;quoterequest&gt;
    &lt;aff&gt;COSTAMAR&lt;/aff&gt; 
    &lt;producer&gt;10527930&lt;/producer&gt;
    &lt;productclass&gt;TBD&lt;/productclass&gt;
    &lt;bookingreservno&gt;0123456789AB&lt;/bookingreservno&gt; 
    &lt;numinsured&gt;3&lt;/numinsured&gt;  
    &lt;tripcost&gt;5000.00&lt;/tripcost&gt; 
    &lt;departdate&gt;2009-11-01&lt;/departdate&gt;
    &lt;returndate&gt;2009-11-20&lt;/returndate&gt;
    &lt;initdate&gt;2008-09-30&lt;/initdate&gt;
    &lt;finalpaymentdate&gt;2008-10-30&lt;/finalpaymentdate&gt; 
    &lt;triptype&gt;Cruise&lt;/triptype&gt;
    &lt;destination&gt;Europe/ Mediterranean&lt;/destination&gt; 
    &lt;supplier&gt;Carnival Cruise Lines&lt;/supplier&gt;
    &lt;airline&gt;American&lt;/airline&gt;
  &lt;/quoterequest&gt;
  </code></pre>
  
  <p>Is there a way to make it work as expected on .NET? </p>
  
  <p>Thanks</p>