title: jQuery.ajax() log the HTTP request
body: <p>I have a function that sends an HTTP POST request and i want to log it for debugging purposes. Here is the function:</p>
  
  <pre><code>function serverRequest(URL, DATA, callback) {
      $.ajax({
          url: URL,
          type: "POST",
          dataType: "text",
          contentType: "text/xml",
          processData: false,
          data: DATA,
          success: function (response) {
              console.log(response);
              callback(response);
          },
          error: function (response) {
              console.log(response);
              callback(null);
          }
      });
  }
  </code></pre>
  
  <p>How can i log the whole HTTP POST request (HTTP Header + data), as soon as it is send?</p>
  
  <p>Thanks.</p>