title: CUrl PUT with xml data
body: <p>I'm facing a problem with curl as I am unable to issue a PUT request with inline XML data, I'm not sure how its done but I hade a couple of goes on it with different techniques. First I tried using the <code>CURLOPT_UPLOAD</code> as its the default CURL option for PUT and tried to append the xml data manually:</p>
  
  <pre><code>    typedef map&lt;string, string&gt; headers_t;
      std::string strCommand = &lt;XMLCOMMAND&gt;
  
  PUTRequest(param1, param2, ...)
      {
  ...
      headers_t headers;
      int nLen = strCommand.length();
      stringstream issLen;
          issLen &lt;&lt; nLen;
          issLen &gt;&gt; strln;
      curl_easy_setopt(curl, CURLOPT_UPLOAD, true); // HTTP PUT
      headers.append("Content-Length: "+ strln); //
      headers.append(strCommand);
  ...
      }
  </code></pre>
  
  <p>Then I tried the same method but using the <code>CURLOPT_POSTFIELDS</code> and <code>CURLOPT_POSTFIELDSIZE</code> instead of manually appending the command to the HTTP headers.... did not work.</p>
  
  <p>Then I tried customizing the PUT request using the <code>CURLOPT_CUSTOMREQUEST</code>option and setting the parameter to PUT and also manually appending the command and using the POSTFIELDS method.</p>
  
  <p>Sadly none worked and now I'm clueless as of what to try next.</p>