title: How to send body data from $.ajax in POST request?
body: <p>
  I am working in a web client and I would like to send a post request using $.ajax from jquery. I am able to send a request as expected using POSTMAN client as I show in the following picture:
  </p>
  
  <p><img src="https://s1.postimg.org/qv93dhoa7/postman.png" alt="Postman request"></p>
  
  <p>
  When I try to do it from jquery like this:
  </p>
  
  <pre><code>$.ajax({
          url: urlRequest,
          type: "POST",
          contentType: "application/json;charset=utf-8",
          headers:{
              "Authorization": "Basic " + btoa(username + ":" + password)
          },
          data:{                
              "summary":"Creating a new ticket",
              "company":{
                  "id": 201
              }                
          },
          success: function (results) {
              alert('Ticket ' + results.id + ' successfully created');
          },
          error: function (x, y, z) {
              alert('Network error has occurred. Please try again!');
          }
      });
  </code></pre>
  
  <p>
  I have a "400 Bad Request" response from the server. I have the same data in both headers (POSTMAN and JQUERY) and I do not have any problem with authorization. It seems like I am not sending the data as expected.
  </p>
  
  <p>
  How should I have to send the data from body in the $.ajax function?. Thanks in advance.
  </p>