title: Send XML over request and XMLHttpRequest
body: <p>I'm trying to send XML data to an API but I don't get any response but  <code>&lt;html&gt;&lt;/html&gt;</code>
  .The question is if I'm doing something wrong or the target server...</p>
  
  <p>Can I send the XML as a string in using request ? 
  like:</p>
  
  <pre><code>var xml = '' +
    '&lt;?xml version="1.0" encoding="UTF-8"?&gt;' +
    '&lt;Request version="1.0"&gt;' +
    '&lt;Header&gt;'+
    '&lt;Security sender="'+ 123456 +'" /&gt;' +
    '&lt;/Header&gt;' +
    ' &lt;Transaction mode="LIVE"&gt;' +
    '     &lt;User login="'+ login +'" pwd="'+ pwd +'"/&gt;' +
    ' &lt;/Transaction&gt;' +
    '&lt;/Request&gt; '
  
  // request type 1  
      request.post({
        headers: {'content-type' : 'application/x-www-form-urlencoded', 'charset' : 'UTF-8'},
        url:     'https://test.url.io',
        body:    xml
      }, function(error, response, body){
        if (error) { return console.log(err); }
        console.log(body);
      });
  </code></pre>
  
  <p>Same <code>&lt;html&gt;&lt;/html&gt;</code> result when I use XMLHttpRequest</p>
  
  <pre><code>// request type 2
  var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
  var xmlhttp = new XMLHttpRequest();
  xmlhttp.open("POST","https://test.url.io",true);
  xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xmlhttp.setRequestHeader('charset', 'UTF-8');
  xmlhttp.send(escape(xml));
  </code></pre>
  
  <p>Here the API description:</p>
  
  <p><strong>Request Encoding</strong>
  For all requests the request header must contain the Content-Type / charset parameter with the
  charset encoding set to “UTF-8”. The actual content type may differ; the decisive information is the charset 
  Platform Documentation – XML Integrator 7
  value.</p>
  
  <p>Accordingly, all request data must be encoded using the UTF-8 character set.
  For XML data, please use the following Content-Type: application/x-www-form-urlencoded;charset=UTF-8</p>
  
  <p>Examples:
  Integration via PHP/cURL: <a href="http://php.net/manual/de/book.curl.php" rel="nofollow noreferrer">http://php.net/manual/de/book.curl.php</a></p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLINFO_HEADER_OUT, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(
   "Content-Type: application/x-www-form-urlencoded;charset=UTF-8"
   ));
  
  // attach parameter
  curl_exec($ch);
  </code></pre>
  
  <p>Integration via Java:</p>
  
  <pre><code> UrlRequest req = new UrlRequest(UrlRequest.POST, CORE_URL );
      // attach parameter to request
      req.addHeaderParam("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
      req.send();
  </code></pre>