title: "405 Method Not Allowed" error while trying to send req. via JS fetch API to PHP file
body: <p>I'm trying to use PUT, PATCH, UPDATE etc. methods on my project to learn how REST works. </p>
  
  <p>I used JS fetch API to send requests and I got "405 Method Not Allowed" error. I searched it then changed my .htaccess to this:</p>
  
  <pre><code>Header add Access-Control-Allow-Origin "*"
  Header add Access-Control-Allow-Headers "*"
  Header add Access-Control-Allow-Methods "GET, PUT, POST, UPDATE, DELETE, OPTIONS"
  </code></pre>
  
  <p>I used that website to check if all headers are correct:<br>
  <a href="https://www.webconfs.com/http-header-check.php" rel="nofollow noreferrer">https://www.webconfs.com/http-header-check.php</a></p>
  
  <p>result is:</p>
  
  <pre><code>HTTP/1.1 200 OK =&gt; 
  Date =&gt; Mon, 01 Jul 2019 14:36:58 GMT
  Server =&gt; Apache/2
  X-Powered-By =&gt; PHP/5.6.40
  Cache-Control =&gt; max-age=2592000
  Expires =&gt; Wed, 31 Jul 2019 14:36:58 GMT
  Vary =&gt; Accept-Encoding,User-Agent
  Access-Control-Allow-Origin =&gt; *
  Access-Control-Allow-Headers =&gt; *
  Access-Control-Allow-Methods =&gt; GET, PUT, POST, UPDATE, DELETE, OPTIONS
  Connection =&gt; close
  Content-Type =&gt; text/html; charset=UTF-8
  </code></pre>
  
  <p>Result contains</p>
  
  <pre><code>Access-Control-Allow-Methods =&gt; GET, PUT, POST, UPDATE, DELETE, OPTIONS
  </code></pre>
  
  <p>and JS XHR still gives 405 error.</p>
  
  <p>What is the problem? Thank you for your answers.</p>