title: Sending Post Data through a HTTP Request POST
body: <p>I am trying to post data from a Textarea to a classic ASP script that updates the MS SQL on the local machine then posts to a PHP script on another server. However doing the below does not work, as it will cut off the data for the textarea. It has special characters in it for HTML and other data.</p>
  
  <p>So my question is, how do I pass this data through a POST using ASP Classic?</p>
  
  <p>I have been searching all day, so hopefully someone can enlighten me, thanks!</p>
  
  <pre><code>    strUrl = "http://www.example.com/index.php"
      requestData = request("request")
      requestData2 = request("request2")
  
      strData = "request=" &amp; requestData &amp; "&amp;request2=" &amp; requestData2
  
      postHTML (strUrl, strData)
  
  function postHTML (strUrl, strData)
      Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP")
      xmlHttp.Open "POST", strUrl, False
      xmlHttp.setRequestHeader "User-Agent", "asp httprequest"
      xmlHttp.setRequestHeader "content-type", "application/x-www-form-urlencoded"
      xmlHttp.Send strData
      postHTML = xmlHttp.responseText
      xmlHttp.abort()
      set xmlHttp = Nothing   
  end function
  </code></pre>
  
  <p>For example if an <code>&amp;</code> is in the requestdata2, anything after that <code>&amp;</code> is truncated, because it is thinking it is starting a new string. But I want to be able to pass this along.</p>
  
  <p>Only Solution I can think of as of right now: do a string replace for special characters such as <code>=</code> and <code>&amp;</code> and restore them with another string replace on the php server. This however is not what I want to accomplish this task. I would like the correct way of sending a post.</p>