title: How to send a HTTP POST from Classic ASP with a parameter to a WEB API?
body: <p>I am trying to create a call to a WEB API on the same machine on another port. It works fine and sends back the string and hits the .NET breakpoint but the parameter is never being passed..(it is null) .. Is there something I am missing in the classic ASP code to pass that string ? (DataToSend)</p>
  
  <p>My calling code:</p>
  
  <pre><code>  &lt;%
        Response.Buffer = True
        Dim xml
       ' Set xml = Server.CreateObject("Microsoft.XMLHTTP")
      Set xml = server.Createobject("MSXML2.XMLHTTP")
  
       DataToSend="&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;codes sku=""123123"" num-codes=""234234"" /&gt;"
  
        xml.Open "POST", _
            "http://localhost:1303/api/RegistrationCode", _
            False
  
        xml.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
        xml.setRequestHeader "X-VitalSource-API-Key", "xxx"
  
        xml.Send DataToSend
  
        'Display the HTML both as HTML and as text
        Response.Write "&lt;h1&gt;The HTML text&lt;/h1&gt;&lt;xmp&gt;"
        Response.Write xml.responseText
        Response.Write "&lt;/xmp&gt;&lt;p&gt;&lt;hr&gt;&lt;p&gt;&lt;h1&gt;The HTML Output&lt;/h1&gt;"
        Response.Write xml.responseText
        Set xml = Nothing
  %&gt;
  </code></pre>
  
  <p>WEB API code:</p>
  
  <pre><code>   public class RegistrationCodeController : ApiController
  {
      string testXmlString = "&lt;SomeValue&gt;6&lt;/SomeValue&gt;";
  
  
  
         public string Post([FromBody]string value)
      {
          return testXmlString;
      }
  
  }
  </code></pre>