title: PHP Curl request to IIS results in request format is invalid
body: <p>I am trying to use curl to access 3rd party webservice, I used the following code which works well if I try it on my own linux server, the data is being sent ok, but the IIS on the 3rd party server returns an error.</p>
  
  <p>$longdata is a long string of data, maybe over 1000 characters long</p>
  
  <p>the 3rd party has many working clients with various implementations so the problem is on my side.</p>
  
  <p>what do I need to add to the request in order to get this through ?</p>
  
  <pre><code>&lt;?php
  
      $c = curl_init();
  
  //  curl_setopt($c, CURLOPT_HTTPHEADER, array('Expect:'));
      curl_setopt($c, CURLOPT_URL, 'http://XXX.com/test/index.asmx');        
      curl_setopt($c, CURLOPT_POST, 1);
      curl_setopt($c, CURLOPT_HEADER, 1);
      curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  
      $post = array('param1' =&gt; 'XXXX', "param2" =&gt; "Y", "Param3" =&gt; $long_data);
  
      curl_setopt($c, CURLOPT_POSTFIELDS, $post);
  
      $response = curl_exec($c);
  
      echo $response;
  
      /*
  
      Response:
  
      HTTP/1.1 100 Continue
  
      HTTP/1.1 500 Internal Server Error
      Date: Tue, 05 Apr 2011 14:11:51 GMT
      Server: Microsoft-IIS/6.0
      X-Powered-By: ASP.NET
      X-AspNet-Version: 2.0.50727
      Cache-Control: private
      Content-Type: text/plain; charset=utf-8
      Content-Length: 100
  
      Request format is invalid: multipart/form-data; boundary=----------------------------5d738237d9e0.
  
      */
  ?&gt;
  </code></pre>