title: Send data with PUT-Request
body: <p>I want to send data with a PUT request.</p>
  
  <p>I have an input field for the data to send.
  with submit I want to send the data.</p>
  
  <p>my data are in JSON format.</p>
  
  <p>This is only for a pentest - so it has to be a PUT Request</p>
  
  <p>Here is the code:
      </p>
  
  <pre><code>&lt;header&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="javascript"&gt;
  
  $(document).ready(function(){
  
  $(#submit).click(){
      var xmlHttp = getNewHTTPObject(); //returns a XMLHttpRequest object
      function chargeURLPut(url) { 
          var mimeType = "text/plain";  
          xmlHttp.open('PUT', url, true);  // true : asynchrone false: synchrone
          xmlHttp.setRequestHeader('Content-Type', mimeType);  
          xmlHttp.send($(#data).val(); 
  }}});
  
  &lt;/script&gt;
  &lt;/header&gt;
  &lt;body&gt;
    &lt;form&gt;
      Data:&lt;br&gt;
      &lt;input id="data" type="text" name="data" value="Mickey"&gt;&lt;br&gt;
      &lt;input id="submit" type="submit" value="Submit"&gt;
   &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But the data are added to the URL like GET-Parameters. After the HTTP header, I want data like "{date: foo....}"</p>
  
  <p>Here is an example Request below:</p>
  
  <pre><code>PUT /foo/bar/v1/users HTTP/1.1
  Host: www.foo.bar
  User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
  Accept: */*
  Accept-Language: de,en-US;q=0.7,en;q=0.3
  Accept-Encoding: gzip, deflate, br
  Referer: https://www.foo.bar/frontend/
  Content-Type: application/json;charset=UTF-8
  Authorization: eyJhbGciOiJSUzUxMiJ9.eyJzdW
  origin: https://www.foo.bar
  Content-Length: 598
  Connection: close
  
  {foo: bar, foo:bar}
  </code></pre>