title: php cors issue with axios post
body: <p>I have a simple post request with axios to php script which renders some pdfs and should return a String.</p>
  
  <p>Now I got this error: </p>
  
  <pre><code>Access to XMLHttpRequest at 'IP:7580/pdfgen/pdfGen.php' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
  </code></pre>
  
  <p>I set this in my php file:</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
  
  header('Access-Control-Allow-Origin: *');
  </code></pre>
  
  <p>With no changes. also tried this:</p>
  
  <pre><code>header('Access-Control-Allow-Origin: *');
  header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
  header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, X-Requested-With");
  </code></pre>
  
  <p>also no changes.</p>
  
  <p>my axios call looks like this:</p>
  
  <pre><code>axios.post("http://IP:7580/pdfgen/pdfGen.php", this.state)
          .then(response =&gt; {
              report = {...this.state.report};
              report.createdAt = reportCreatedAt;
  
              window.open(response.data);
  
  
              this.setState({report: report, pdf: response.data});
              console.log(response);
          })
  </code></pre>
  
  <p>What could solve this?</p>
  
  <p>Thanks in advance</p>