title: Response for preflight has invalid HTTP status code 405
body: <p>I have read many similar problems in StackOverflow, but the solutions doesn't work for me.  </p>
  
  <p>I have WCF REST service:</p>
  
  <pre><code>[&lt;OperationContract&gt;]    
      [&lt;WebInvoke(UriTemplate = "PostItem", 
              RequestFormat= WebMessageFormat.Json,   
              ResponseFormat = WebMessageFormat.Json, Method = "POST")&gt;]         
  </code></pre>
  
  <p>I can use it using Postman (Chrome extension). I am passing data as 'raw', not 'urlencoded'.  And I get 200 return code.</p>
  
  <p><a href="https://i.stack.imgur.com/Mzxhj.png"><img src="https://i.stack.imgur.com/Mzxhj.png" alt="enter image description here"></a></p>
  
  <p>I need to call this method using angularjs:</p>
  
  <pre><code>    $http.post('http://192.168.1.65/Service1.svc/restapi/PostItem',                   
                  {
      "Address": "г. Москва, ул. Соколово-Мещерская, д.25",
       ...
      "User": ""
        })  
  </code></pre>
  
  <p>I have just copied URL and JSON from Postman.  But I get the error:</p>
  
  <blockquote>
    <p>angular.js:10722 OPTIONS
    <a href="http://192.168.1.65/Service1.svc/restapi/PostItem">http://192.168.1.65/Service1.svc/restapi/PostItem</a>
    <a href="http://192.168.1.65/Service1.svc/restapi/PostItem">http://192.168.1.65/Service1.svc/restapi/PostItem</a>. Response for
    preflight has invalid HTTP status code 405</p>
  </blockquote>
  
  <p>I have searched similar problems and have found two solutions:</p>
  
  <ol>
  <li>Use jQuery to set header <code>Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'</code>, but it doesn't work with my WCF service</li>
  <li><p>Set custom headers in my Web.Config:</p>
  
  <pre><code>&lt;httpProtocol&gt;
     &lt;customHeaders&gt;
        &lt;add name="Access-Control-Allow-Origin" value="*" /&gt;
        &lt;add name="Access-Control-Allow-Headers" value="Content-Type" /&gt;
        &lt;add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" /&gt;
     &lt;/customHeaders&gt;
  &lt;/httpProtocol&gt;
  </code></pre></li>
  </ol>
  
  <p>It doesn't help me. And I am not sure that the reason of the error on the server side.  The Postman extension can call this method succesfully.</p>
  
  <p>How can I make the same POST call using AngularJS ?</p>
  
  <p><strong>Update</strong>:</p>
  
  <p>Here is OPTIONS request:</p>
  
  <p><a href="https://i.stack.imgur.com/Kky9n.png"><img src="https://i.stack.imgur.com/Kky9n.png" alt="enter image description here"></a></p>
  
  <p>Review and Response tabs are empty</p>
  
  <p><strong>Update 2:</strong></p>
  
  <p>All works fine in IE, but doesn't work in Chrome.</p>