title: Don't set POST request on api, get 406 Not Acceptable
body: <p>Don't set POST request on api, get 406 Not Acceptable.
  Tried to use axios and got 406 error. Was think that axios cause of the problem. Then I tried to use fetch() and got again 406 error. </p>
  
  <p>I think that not seted header <code>Content-Type</code>, when I send his - get 400 Bad Request and in tab Preview <code>Unauthorized header content-type</code>.</p>
  
  <p>Need your help, what am I doing wrong?
  Thanks everyone for help.</p>
  
  <ul>
  <li>Environment: node v8.9.4, chrome 64.0.3282.119, Ubuntu 16.04</li>
  <li>axios version: 0.16.2</li>
  <li>Vue.js 2.4.2</li>
  <li>vue-axios 2.0.2</li>
  <li>api-platform/api-pack: 1.0</li>
  <li>Symfony 4.0.4</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/NBL80.png" rel="nofollow noreferrer">Headers</a>
  <a href="https://i.stack.imgur.com/V69R6.png" rel="nofollow noreferrer">Review</a></p>
  
  <p><strong>First example fetch() code:</strong></p>
  
  <pre><code>const json = JSON.stringify({
      a: 1,
      b: 2,
  });
  fetch('http://localhost:8080/api/products', {
      method: 'POST',
      headers: {
           // 'Content-Type': 'application/json',
      },
      body: json,
  });
  </code></pre>
  
  <p><strong>Second example Axios code:</strong></p>
  
  <pre><code>const data = JSON.stringify({
      data: this.cardData.brand,
  });
  const configAxios = {
      headers: {
       // 'Content-Type': 'application/json',
       },
  };
  axios.post('api/products', data, configAxios)
  .then((res) =&gt; {
      this.cardData.brand = res.data;
      console.log(res);
  })
  .catch((err) =&gt; {
      console.warn('error during http call', err);
  });
  </code></pre>