title: Call the REST API url using asp.net / JQuery Ajax
body: <p>I have to call a REST url for example : https://{baseurl}/employees/taxvalidation/. The Request type is JSON, but I'am always get the error Alert. I can't figure out what is the wrong in my code. I am using JQuery</p>
  
  <p>The Supported HTTP Method is : PUT (HTTP PUT with correct request needs to be made) and also i need to pass a API key: XXXXX-XXXXX-XXXXX-XXXXX as  request Header. </p>
  
  <p>I have just have two mandatory fields in web page Employee name and Employee Tax.
  I have tried the below using JQuery Ajax call.</p>
  
  <p>Request Body Sample:</p>
  
  <pre><code> "name": "Company XYZ",  /* mandatory */
   "TAX": "*********",  /* mandatory */
   "taxType": "U", /* Could be E, S, or U */
   "address": "2501 Boilermaker road", /* optional */
   "citystatezip":"Lapalma ca 76567", /* optional */
   "country": "US", //optional
   "checks" : "DT",`enter code here`
   "details": "DT"`enter code here` //optional
  
  $(function() {
      $("#btnSubmit").click(function() {
          alert("Hi JQuery");
          var URL = "https://api.dev.amx-city.com/tesmdm/dev/tesmdm/empcatalog/partners/taxvalidation/";        
          $.ajax({
              url: URL,
              headers : {
                  'AMX-API-KEY': '487b9474-27a6-4d21-8eda-c3a2a14e4ebe'
              },
              type: 'POST',    
              data: {
                  name: 'Employeename',
                  tin: '79847324987',
                  tinType: 'U'
              },
              dataType: 'json',
              success: function(result) {
                  alert(result);
              },
              error: function (restul) {
                  alert(result);
          }
          });
  });
  });
  </code></pre>
  
  <p>when i try to hit the button the debugging is stopped till Alert, after that i don't see the URL is hitting. Let me know if i am doing any wrong?</p>