title: Why axios do not handle with 'Content-Type': 'application/json'
body: <p>I'm making requests with Axios and everything works correctly, but if there is an error in the PHP API like: &quot;Undefined index:...&quot;. Axios doesn't handle the error with 'Content-Type': 'application/json'</p>
  <pre><code>const API = axios.create({
    baseURL: URL + &quot;/api/&quot;,
    headers: {
      'Content-Type': 'application/json',
    }
  })
              let data = {
                orderList: {
                  limit: 10,
                  page: page,
                  orderby: orderBy,
                  search: search
                }
              };
              data = qs.stringify(data);
              let orderList;
              await API.post(&quot;api.php&quot;, data, {
                headers: {
                  'Content-Type': 'application/json',
                }
              }).then(response =&gt; {
                orderList = response.data;
              }).catch(() =&gt; {
                orderList = 'Network Error';
              })
              return orderList;
            },
  </code></pre>
  <p>I wanted it to return only the JSON result from the API, if not, trigger catch. However catch is not being triggered.</p>