title: How to call web API with GET method basic authentication into jquery() in javascript
body: <p>Hello I am using this method to read this api it giving CORS error. I have added CORS plugin with chrome then also it is not coming. Please let me know how to solve these to error.</p>
  
  <p>text:</p>
  
  <pre><code> function NoCors() {
          debugger;
          var uName = "*****";
          var passwrd = "*****";
          document.write("Enter1");
          var url = 'http://219.90.67.163:8207/api/Info/getgismeterdata'
          $.ajax({
              type: 'GET',
              url: url,
              crossDomain: true,
              //Access-Control-Allow-Credentials: true,
              contentType: 'json',
              datatype: "application/json",
              headers: {
                  "Authorization": "Basic QXBpVXNlcjpBcGlQYXNz",
              },
  
              beforeSend: function (xhr) {
                  xhr.setRequestHeader('Authorization', "Basic " + btoa(uName + ":" + passwrd));
              },
              success: function (data) {
                  debugger;
                  console.log("data")
                  //Success block 
              },
              error: function (xhr, ajaxOptions, throwError) {
                  //Error block 
              },
          });
      }
  </code></pre>
  
  <p>error in console:
  1. Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
  2. Access to XMLHttpRequest at '<a href="http://219.90.67.163:8207/api/Info/getgismeterdata" rel="nofollow noreferrer">http://219.90.67.163:8207/api/Info/getgismeterdata</a>' from origin '<a href="http://localhost:50362" rel="nofollow noreferrer">http://localhost:50362</a>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.</p>