Mohsin Arif

Mohsin Arif

  • 295
  • 6k
  • 137.8k

API does not respond?

Dec 31 2019 5:45 AM
hello guys.
 i have a issue, i have  a restricted api which is only executed through permitted PC (IPs) . ii integrated in my application thats fine running on server i hae hosted . but when i hit through client machine api not respond. i use ajax call  to get response. 
 
i think there is isssue to hit api on permitted IPs but client machine's IPs is not permitted. so what can i do for fix this issue... 
  1. $.ajax({  
  2.                     type: "GET",  
  3.                     headers: {  
  4.                         "Authorization": token,  
  5.                         "Access-Key": accessKey,  
  6.                     },  
  7.                     url: APiUrl,  
  8.                       
  9.                     success: function () {  
  10.                         $('.preloader').fadeOut('slow');  
  11.                         $('#close').click();  
  12.                         $('#divHide').show();  
  13.                          
  14.                     },  
  15.                     error: function () {  
  16.                         $('.preloader').fadeOut('slow');  
  17.                         $('#close').click();  
  18.                           
  19.                         $.toaster({ priority: "danger", title: "oooppss!", message: "API server is not responding at the moment please try again Later thank you." });  
  20.   
  21.                     },  
  22.                 }).done(function (data) {  
  23. // response populate in datatable
  1. }  
 

Answers (1)