title: React and Springboot : axios requests not shown in browser devtools
body: <p>I'm trying to follow a tutorial on React(frontend) and Springboot(backend) and I face a little problem when making an http POST request with Axios on Mozilla and Chrome. I try to post some data to a REST api that I set up and save it in an H2 in-memory database. If I use an HTTP client
  like Postman, it works fine but when I use a web browser as a client, here are some issues :</p>
  <ul>
  <li>On Chrome, when I submit the form, I don't see any trace of the triggered request in the Network tab of the console while the data is saved in the database. I also have this browser error message when I run my React client :</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/ucCW9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ucCW9.png" alt="console error shown in Chrome when running my app" /></a></p>
  <ul>
  <li>On Firefox, the request doesn't hit my rest controller endpoint and no data is persisted. But I get this error message</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/t0iCZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t0iCZ.png" alt="error message in Firefox when submitting the form" /></a></p>
  <p>I configured my CORS, checked proxy config in package.json but I don't get what the issue is.</p>
  <p>my http post method called from my form component when submitted
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import axios from 'axios';
  
  const API_URL = 'http://localhost:8080/api/v1';
  
  export const signup = (user) =&gt; {
      const headers = {"Accept": "application/json", 'Content-Type': 'application/json'};
      return axios.post(API_URL + '/auth/signup', user, {headers})
      .then(res =&gt; console.log(res));
  };</code></pre>
  </div>
  </div>
  </p>
  <p>my package.json
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "name": "project-frontend",
    "version": "0.1.0",
    "private": true,
    "proxy": "http://localhost:8080",
    "dependencies": {
      "@testing-library/jest-dom": "^5.11.9",
      "@testing-library/react": "^11.2.4",
      "@testing-library/user-event": "^12.6.3",
      "axios": "^0.21.1",
      "http-proxy-middleware": "^2.0.0",
      "react": "^17.0.1",
      "react-dom": "^17.0.1",
      "react-scripts": "4.0.1",
      "web-vitals": "^0.2.4"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
    },
    "eslintConfig": {
      "extends": [
        "react-app",
        "react-app/jest"
      ]
    },
    "browserslist": {
      "production": [
        "&gt;0.2%",
        "not dead",
        "not op_mini all"
      ],
      "development": [
        "last 1 chrome version",
        "last 1 firefox version",
        "last 1 safari version"
      ]
    }
  }</code></pre>
  </div>
  </div>
  </p>
  <p>My rest controller
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>package com.project.project.auth;
  
  import com.project.project.shared.HttpResponse;
  import com.project.project.user.User;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.*;
  
  import java.util.logging.Logger;
  
  @CrossOrigin(origins = "http://localhost:3000")
  @RestController
  @RequestMapping("/api/v1/auth")
  public class AuthController {
  
      @Autowired
      private AuthService authService;
  
      public Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
  
      @PostMapping("/signup")
      public HttpResponse signup(@RequestBody User user) {
          logger.info("AUTH_CONTROLLER : I'am in signup method");
          authService.save(user);
          HttpResponse response = new HttpResponse("User saved succesfully !");
          return response;
      }
  }</code></pre>
  </div>
  </div>
  </p>