title: CORS preflight returns 200 but subsequent PUT never happens (Angular JS with external REST API)
body: <p>I'm working with an <strong>Angular app</strong> that talks to a <strong>REST api</strong>.</p>
  
  <p>I have set up access-control so that my GET requests are working as expected. (The browser sends a preflight OPTIONS request and then the subsequent GET fires).</p>
  
  <p>However, I am running into problems with my PUTs. </p>
  
  <p><strong>The problem</strong> is that with PUTs the options preflight seems to return okay but then the PUT never fires.</p>
  
  <p>First I will show what works and then what is failing. I am using Charles to spy on the calls.</p>
  
  <hr>
  
  <h1>GET (working)</h1>
  
  <p>1) preflight request</p>
  
  <pre><code>OPTIONS /v1/account HTTP/1.1
  Host    api.mysite.com
  Access-Control-Request-Method   GET
  Origin  http://127.0.0.1:9000
  User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36
  Access-Control-Request-Headers  accept, authorization
  Accept  */*
  Referer http://127.0.0.1:9000/
  Accept-Encoding gzip,deflate,sdch
  Accept-Language en-US,en;q=0.8
  </code></pre>
  
  <p>2) preflight response</p>
  
  <pre><code>HTTP/1.1 200 OK
  Server  nginx/1.6.0
  Date    Wed, 21 May 2014 15:43:25 GMT
  Content-Type    application/octet-stream
  Content-Length  0
  Connection  keep-alive
  Access-Control-Allow-Origin *
  Access-Control-Allow-Methods    *
  Access-Control-Allow-Headers    Origin, X-Requested-With, Content-Type, Accept, Authorization, WWW-Authenticate, X-BLURR-DEBUG
  Access-Control-Allow-Credentials    true
  </code></pre>
  
  <p>3) The GET request</p>
  
  <pre><code>GET /v1/account HTTP/1.1
  Host    api.mysite.com
  Accept  application/json, text/plain, */*
  Origin  http://127.0.0.1:9000
  User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36
  AUTHORIZATION   DFHD8D...
  Referer http://127.0.0.1:9000/
  Accept-Encoding gzip,deflate,sdch
  Accept-Language en-US,en;q=0.8
  </code></pre>
  
  <p>4) The GET response</p>
  
  <pre><code>{ some json as expected }
  </code></pre>
  
  <hr>
  
  <h1>PUT (not working)</h1>
  
  <p>Now, here is the <strong>PUT</strong> that seems to return an okay preflight response but never gets to the PUT request:</p>
  
  <p>1) preflight request</p>
  
  <pre><code>OPTIONS /v1/account HTTP/1.1
  Host    api.mysite.com
  Access-Control-Request-Method   PUT
  Origin  http://127.0.0.1:9000
  User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36
  Access-Control-Request-Headers  accept, authorization, content-type
  Accept  */*
  Referer http://127.0.0.1:9000/
  Accept-Encoding gzip,deflate,sdch
  Accept-Language en-US,en;q=0.8
  </code></pre>
  
  <p>2) preflight response</p>
  
  <pre><code>HTTP/1.1 200 OK
  Server  nginx/1.6.0
  Date    Wed, 21 May 2014 15:51:41 GMT
  Content-Type    application/octet-stream
  Content-Length  0
  Connection  keep-alive
  Access-Control-Allow-Origin *
  Access-Control-Allow-Methods    *
  Access-Control-Allow-Headers    Origin, X-Requested-With, Content-Type, Accept, Authorization, WWW-Authenticate, X-BLURR-DEBUG
  Access-Control-Allow-Credentials    true
  </code></pre>
  
  <hr>
  
  <h1>The problem</h1>
  
  <p>It seems that the <strong>preflight</strong> response for the PUT is okay, so I'm not sure why the browser never sends the <strong>actual</strong> PUT request.</p>
  
  <p>Any help or direction would be great! Thank you</p>