title: Can't get the Rest Post response in Jquery Ajax post call
body: <p>I am calling the Rest call using the Ajax post method but i get the below error or response. </p>
  
  <pre><code>{"readyState":0,"status":0,"statusText":"error"}
  </code></pre>
  
  <p>Even i enable the cors($.support.cors = true; ) and crossDomain (crossDomain: true (add in headers)). </p>
  
  <p>Here is the sample request:- </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function() {
          $.support.cors = true;         
          var evergentData = {
          "UpdateContactRequestMessage":{
           "channelPartnerID":"123456",
         "email":"greg@gmail.com",
         "firstName":"greg",
         "lastName":"chappel",
         "externalId":"GC123",
         "sessionToken":"f53095854bb230996f54fe32ed5a63f68c7718c7"
          }
        };
        
        //GetProducts();
        
        jQuery.ajax({
          type: 'POST',
          url: 'url for rest api call',
          contentType: "application/json",
          Accept: "application/json; charset=utf-8",
          dataType: 'json',
          data: evergentData,
          //data: JSON.stringify(evergentData),
          crossDomain: true,
          processData: true,
          headers: { 'access-control-allow-origin': '*',
          },
           success: function(resp){  
               // we have the response  
               alert("Server said123:\n '" + resp + "'");  
             },  
             error: function(e){  
               alert('Error121212: ' + e);  
               alert(e.toString());
               console.log('my message' + e);
               console.log('tables: ' + JSON.stringify(e));
             } 
             
            
        });
      };</code></pre>
  </div>
  </div>
  
  But i tested this Restapi call in the 'postman' google chrome extension i got the response(successfully got the response).</p>
  
  <p>Here is the response headers:-</p>
  
  <pre><code>access-control-allow-headers → client_type, content-type, accept, accept-language, auth_token_base64, appID, accept-encoding, content-length, x-requested-with
  </code></pre>
  
  <p>access-control-allow-methods → POST, GET, OPTIONS, DELETE</p>
  
  <p>access-control-allow-origin → *</p>
  
  <p>allow → GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS</p>
  
  <p>content-length → 92</p>
  
  <p>content-type → application/json</p>
  
  <p>x-frame-options → sameorigin</p>
  
  <p>x-webobjects-loadaverage → 0</p>
  
  <p>Anyone help me why i didn't get response from rest api call in JqueryAjax post calls.</p>
  
  <p>Thank's advance.</p>