title: Response for preflight has invalid HTTP status code 405 on Angular Js1 and Webapi 2
body: <p>Error:</p>
  
  <pre><code>OPTIONS http://localhost:8080//api/home/GetText 405 (Method Not Allowed)
  
  http://localhost:8080//api/home/GetText. Response for preflight has invalid HTTP status code 405
  angular.js:14362 Error: Error getting home/GetText data from the database! 
  Headers:
  </code></pre>
  
  <p>Response Headers:</p>
  
  <pre><code>Access-Control-Allow-Credentials:false
  Access-Control-Allow-Headers:gid,Origin, X-Requested-With, Content-Type, Accept, Authorization
  Access-Control-Allow-Methods:GET, POST, PUT, DELETE, OPTIONS
  Access-Control-Allow-Origin:*
  Allow:GET
  Content-Length:76
  Content-Type:application/json; charset=utf-8
  Date:Fri, 28 Jul 2017 10:30:06 GMT
  Server:Microsoft-IIS/10.0
  X-Powered-By:ASP.NET
  </code></pre>
  
  <p>Request Headers:</p>
  
  <pre><code>Accept:*/*
  Accept-Encoding:gzip, deflate, br
  Accept-Language:en-US,en;q=0.8
  Access-Control-Request-Headers:authorization,gid
  Access-Control-Request-Method:GET
  Cache-Control:no-cache
  Connection:keep-alive
  Host:localhost:8080
  Origin:http://evil.com/
  Pragma:no-cache
  Referer:http://localhost:1852/
  User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
  </code></pre>
  
  <p>Please note that i am using Angular Js as client and Webapi for server side. I am performing xhr request through $resource service.</p>